예제 #1
0
$defaults = $emailObj->getSystemDefaultEmail();
$mail = new SugarPHPMailer();
$mail->setMailerForSystem();
//$mail->From = $defaults['email'];
$mail->IsSMTP();
// telling the class to use SMTP
$mail->Host = "mail.vinksoftware.com";
// SMTP server
$mail->SMTPDebug = 2;
// enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true;
// enable SMTP authentication
//$mail->SMTPSecure = 'tls';
$mail->Port = 26;
// set the SMTP port for the GMAIL server
$mail->Username = "******";
// SMTP account username
$mail->Password = "******";
// SMTP account password
$mail->SetFrom('*****@*****.**', 'Vinay Hooloomann');
//$mail->AddReplyTo('*****@*****.**', 'Vinay Hooloomann');
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$address = "*****@*****.**";
$mail->AddAddress($address, "Vinay Hooloomann");
$mail->Body = 'Test';
//$mail->prepForOutbound();
//$mail->AddAddress($email);
$mail->Send();
echo "sent";