Go Daddy Support

Get Help & Support from Go Daddy Staff and Customers

GoDaddy server not connecting to external SMTPs

Viewing post 1 to 7 (7 total posts)
Profile picture of pspdx

pspdx said 1 year, 2 months ago:

Hi,

I have been trying to connect to external SMTP servers (specifically, my university’s mail server mail.lehigh.edu and Gmail’s mail server smtp.gmail.com) to send emails using PHPMailer, however my attempts from GoDaddy’s server have been unsuccessful.

I ran both scripts (the one to try and connect to Lehigh and the one to try and connect to Gmail) on my localhost and they both successfully sent messages (so therefore I know the scripts WORK, just not on GoDaddy).

Here is the Lehigh script:

IsSMTP();
$mail->Host = ‘mail.lehigh.edu’;
$mail->SMTPSecure = ‘tls’;
$mail->SMTPDebug = true;
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->Username = ‘jcg213@lehigh.edu’;
$mail->Password = ‘(mypassword)’;

$mail->SetFrom(‘jcg213@lehigh.edu’, ‘Justin Goodrich’);
$mail->AddReplyTo(‘jcg213@lehigh.edu’, ‘Justin Goodrich’);

$mail->Subject = “Test.”;
$mail->Body = “This is a test.”;

$mail->AddAddress(‘jcg213@lehigh.edu’, ‘Justin Goodrich’);

if(!$mail->Send()) {
echo “Mailer Error: ” . $mail->ErrorInfo;
} else {
echo “Message sent!”;
}

?>

On localhost it runs fine, but on GoDaddy I get this:

SMTP -> ERROR: Failed to connect to server: Connection refused (111)
SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.

I am running Windows on my home server and Linux on GoDaddy, should that matter.

The script to send via Gmail is nearly identical and has the same issues on GoDaddy.

Is GoDaddy blocking my connection to external SMTPs/how do I correct this issue?

Thanks,
Justin

Profile picture of JasonP

GoDaddy Expert JasonP said 1 year, 2 months ago:

@Juston,

We do not allow remote connections to SMTP servers from our shared hosting network. Your local machine is configured differently and you have different permissions than that within a hosted environment.

Sorry,

Jason

Profile picture of usewide

usewide said 1 year, 2 months ago:

if you were able to use smtp protocol with socket, that may give you a way.

Profile picture of JasonP

GoDaddy Expert JasonP said 1 year, 2 months ago:

@usewide,

Unfortunately, our CGI services do not support the creation of socket connections.

Jason

Profile picture of IDD

idd said 8 months, 2 weeks ago:

my site name choicehiphop.com. Anybody please help me where i found following details

$mail->Host = ‘’; //
$mail->SMTPSecure = ‘tls’;
$mail->SMTPDebug = true;
$mail->SMTPAuth = true;
$mail->Port = 587;

Profile picture of gishan

gishan said 8 months, 2 weeks ago:

Use this script with a GoDaddy email account.

Profile picture of christianh

GoDaddy Expert christianh said 8 months, 2 weeks ago:

@idd

In order to be able to send email through our hosting accounts that we offer you must use the following relay server in your code:

relay-hosting.secureserver.net

You do not need to provide a user name and password for this relay server as it does not require authentication. You can use port 25 to send.

–Christian

This topic is closed, replies are no longer accepted.