|
Search:
Advanced search
|
Browse by category:
|
Php mail component |
|||||
Php mail code with authentication Note : For smtp server configuration contact support@space2host.com <?php require_once "Mail.php"; $from = "from id <From email id>"; $to = "to email id <to email id >"; $subject = "This is my subject"; $body = "Hi,\n\nHow are you?"; $headers = array ('From' => $from,
'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!!</p>"); } ?> |
|||||
Powered by
KnowledgebasePublisher (Knowledgebase software)