Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

send_pm

Sends a Private Message to specified user with email notification if the receiver has enabled it.

send_pm

Quote

send_pm ( numeric $to , numeric $from , string $subject , string $message [ string , $smileys] )


Parameters
to

Receiver's user id
from

Sender's user id
subject

Subject of the Private Message
message

Message of the Private Message
smileys

Enable smileys or not. Y to enable and N to disable.

Return Values
Returns different kind of valued depending on the error:
0 - No error
1 - Receiver's inbox is full
2 - Receiver and sender is the same user
3 - Sending user does not exist
4 - Sender does not exist
4 - Receiver does not exist
5 - Floodcontrol exceeded

Example
Code
<?php
require_once INCLUDES."infusions_include.php";
 
$to = 2; // Receiver's user id
$from = 1 // Sender's user id
$subject = "Welcome to PHPFusion";
$message = "Welcome to PHPFusionnnI just wanted to welcome you here to this site.";
 
$sendpm = send_pm($to, $from, $subject, $message);
if ($sendpm == 1) {
 // Error: Receiver's inbox is full
} elseif ($sendpm == 2) {
 // Error: Reciever and sender are the same user
} elseif ($sendpm == 3) {
 // Sender does not exist in DB
} elseif ($sendpm == 4) {
 // Reciever does not exist in DB
} elseif ($sendpm == 5) {
 // Floodcontrol exceeded
} else {
 // Congratulations!
}
?>


Changelog
7.01.00 - Function added to PHPFusion