Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP connect() failed #442

Closed
hamdan-mahran opened this issue Jun 18, 2015 · 8 comments
Closed

SMTP connect() failed #442

hamdan-mahran opened this issue Jun 18, 2015 · 8 comments

Comments

@hamdan-mahran
Copy link

Hello,

Thanks for this awesome plugin and for your time, but i think it will be more awesome if it's work for me :D
I trying to use it to send mails, i make all the steps, set google mail user and password ... etc
The link is http:https://www.enar.ideal-theme.com/html5/ipad/mail/sendemail.php

require 'PHPMailerAutoload.php';

$mail = new PHPMailer;

$mail->isSMTP();                                      
$mail->Host = 'smtp.gmail.com';  
$mail->SMTPAuth = true;                              
$mail->Username = '[email protected]';                
$mail->Password = 'my-password';
$mail->SMTPSecure = 'ssl';                           
$mail->Port = 465; 
$mail->SMTPDebug = 2;

$mail->From = '[email protected]';
$mail->FromName = 'Mailer';
  
$mail->addReplyTo('[email protected]', 'Information');
$mail->addAddress('[email protected]', 'Joe User');                            

$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body in bold!';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

var_dump($mail->send());

I hope to give me your feedback about it

Thanks!

@Synchro
Copy link
Member

Synchro commented Jun 18, 2015

Base your code on the gmail example provided and read the troubleshooting guide, exactly as the error message tells you. There are also over 800 questions on Stackoverflow on this exact subject.

@hamdan-mahran
Copy link
Author

Thanks very much for your reply :)
But i see this article is so complicated for me, and i don't understand, i just want to send a message, and i make all steps ( user - pass - etc )

Thanks!

@Synchro
Copy link
Member

Synchro commented Jun 18, 2015

What that error means is that your server cannot connect to its local network, so everything, including email, is not going to work. Fix your server and PHPMailer can work; but there's nothing that PHPMailer can do to fix your server. You might want to open a support ticket with your hosting provider.

@hamdan-mahran
Copy link
Author

Wow, you is awesome,
I want to thank you a lot for your support, from my heart i don't see any man like you, you is awesome, and i hope you like my last theme on themeforest http:https://themeforest.net/item/enar-responsive-multipurpose-html5-template/11107340

I can send it as a gift if you like it :)

All the best

@Synchro
Copy link
Member

Synchro commented Jun 18, 2015

That's a pretty impressive theme, nice work!

@hamdan-mahran
Copy link
Author

Thanks very much @Synchro , it's my pleasure to like it :)

@evanb2
Copy link

evanb2 commented Jul 2, 2015

I was having this same problem. I tried literally everything, checked everything on my server settings but still nothing.

In the end I removed this one line: $mail->isSMTP();

That fixed my SMTP connection error. Don't know why, but it works. Any ideas @Synchro ?

@Synchro
Copy link
Member

Synchro commented Jul 3, 2015

That's not a fix. You just turned off SMTP. Read the troubleshooting guide.

@Synchro Synchro closed this as completed Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants