Sending emails through SMTP with PHPMailer

前端 未结 8 938
情深已故
情深已故 2020-12-31 07:13

I\'m trying to send SMTP e-mails using PHPMailer, but I keep getting this error message, any ideas how to get rid of it?
I\'m trying to connect via SSL on port 465.

8条回答
  •  感动是毒
    2020-12-31 07:25

    Try to send an e-mail through that SMTP server manually/from an interactive mailer (e.g. Mozilla Thunderbird). From the errors, it seems the server won't accept your credentials. Is that SMTP running on the port, or is it SSL+SMTP? You don't seem to be using secure connection in the code you've posted, and I'm not sure if PHPMailer actually supports SSL+SMTP.

    (First result of googling your SMTP server's hostname: http://podpora.ebola.cz/idx.php/0/006/article/Strucny-technicky-popis-nastaveni-sluzeb.html seems to say "SMTPs mail sending: secure SSL connection,port: 465" . )

    It looks like PHPMailer does support SSL; at least from this. So, you'll need to change this:

    define('SMTP_SERVER', 'smtp.ebola.cz');
    

    into this:

    define('SMTP_SERVER', 'ssl://smtp.ebola.cz');
    

提交回复
热议问题