GoDaddy > mail() not sending emails … solved! [20SEP2014]

To Solve …

Like me you may of been using the `mail` command for years without a hitch … until you found that sent emails, never arrived!. So, please ditch the `mail()` command and the steps below will get your email working again !

1) Download and unpack PHPMailer v.5.2.4 from here :
https://code.google.com/a/apache-extras.org/p/phpmailer/

2) In my example, PHPMailer exists in :

/includes/phpmailer/

3) Copy and paste the script below into a file called /testemail.php

// error_reporting(4);
// error_reporting(E_ALL);
error_reporting(E_ALL);

require 'includes/phpmailer/class.phpmailer.php';

date_default_timezone_set('UTC');
define('SMTP_HOST','smtpout.europe.secureserver.net');
define('SMTP_PORT',25);
define('SMTP_USERNAME','from@mysuperwebsite.com');
define('SMTP_PASSWORD','mypassword');
define('SMTP_AUTH',true);

$email = 'mycustomer@aol.co.uk';

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;                 
$mail->SMTPAuth = SMTP_AUTH;
$mail->Host = SMTP_HOST;
$mail->Port = SMTP_PORT;
$mail->Username =  SMTP_USERNAME;
$mail->Password = SMTP_PASSWORD;
$mail->SetFrom(SMTP_USERNAME,'The Debt-Refund Team');
$mail->AddReplyTo(SMTP_USERNAME,'The Debt-Refund Team');
$mail->Subject    = "Thank you for your enquiry ...";
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML('This is a test.');
$mail->AddAddress($email);
$mail->Send();

* blue text is username/password you use to send emails
* red text is the person you want to email
* green text is your own/company name
* orange text is subject line
* purple text is email message

Run the file – i.e. http://www.mydomain.com/testemail.php
after a moment you’ll get a blank page – which means the email has been sent!
If there was a problem sending the email … you’ll see messages on the screen

YES, It Really Does Work :
godaddy mail not working - solved

Loosely based on : http://aravindisonline.blogspot.co.uk/2012/01/phpmailer-with-godaddy

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Anti-Spam by WP-SpamShield