Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Template Shares (http://www.bvlist.com/forumdisplay.php?f=26)
-   -   Send Mail from PHP Using SMTP Authentication (http://www.bvlist.com/showthread.php?t=6519)

turktiger 31st May 2011 11:09

Send Mail from PHP Using SMTP Authentication
 
When i use smtp settings in tsse 5.6 mail go through spam folder of users is there any way to change tsse smtp settings with smtp authhentication and ssl encrption here are example codes for this ;

i want to send emails via hotmail , yahoo , gmail account

Code:

 require_once "Mail.php";
 
 $from = "Sandra Sender ";
 $to = "Ramona Recipient ";
 $subject = "Hi!";
 $body = "Hi,\n\nHow are you?";
 
 $host = "ssl://mail.example.com";
 $port = "465";
 $username = "smtp_username";
 $password = "smtp_password";
 
 $headers = array ('From' => $from,
  'To' => $to,
  'Subject' => $subject);
 $smtp = Mail::factory('smtp',
  array ('host' => $host,
    'port' => $port,
    'auth' => true,
    'username' => $username,
    'password' => $password));
 
 $mail = $smtp->send($to, $headers, $body);
 
 if (PEAR::isError($mail)) {
  echo("

" . $mail->getMessage() . "

");
  } else {
  echo("

Message successfully sent!

");
  }
 ?>



All times are GMT +2. The time now is 07:53.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.