Report this

What is the reason for this report?

Email Issues

Posted on March 16, 2014

I’ve moved my app over to digitalocean but my notifications aren’t working. I’m using Ubuntu. I’m using php mailer and using the following function function sendEmail($subject, $body, $altbody, $fromEmail, $fromName, $replyToEmail, $to, $cc, $bcc) { $mail = new PHPMailer;

$mail->IsSMTP(); // Set mailer to use SMTP $mail->Host = ‘smtp.gmail.com’; // Specify main and backup server $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = ‘GMAIL ADDRESS’; // SMTP username $mail->Password = ‘PASSWORD’; // SMTP password $mail->SMTPSecure = ‘tls’; // Enable encryption, ‘ssl’ also accepted

$mail->From = $fromEmail; $mail->FromName = $fromName; //$mail->AddAddress(‘RECIPIENT EMAIL’); // Add a recipient $mail->AddReplyTo($replyToEmail); $mail->AddAddress($to); // Name is optional $mail->AddCC($cc); $mail->AddBCC($bcc);

$mail->WordWrap = 50; // Set word wrap to 50 characters //$mail->AddAttachment(‘/var/tmp/file.tar.gz’); // Add attachments //$mail->AddAttachment(‘/tmp/image.jpg’, ‘new.jpg’); // Optional name $mail->IsHTML(true); // Set email format to HTML

$mail->Subject = $subject; $mail->Body = $body; $mail->AltBody = $altbody;

if(!$mail->Send()) { echo ‘Message could not be sent.’; echo 'Mailer Error: ’ . $mail->ErrorInfo; exit; } else { echo “Message has been sent”; }

but I’m getting the error "Message could not be sent.Mailer Error: SMTP Connect() failed.thorn@BlackThorn:~$ "

What should I be using?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.