evop Posted December 18, 2014 Share Posted December 18, 2014 Hi People, I'm using a php to send an mail using a server via ssl. My program: <?php require("class/class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 1; // 0 = no output, 1 = errors and messages, 2 = messages only. $mail->SMTPAuth = true; $mail->SMTPSecure = "ssl"; $mail->Host = "webmail.***.srv.br"; $mail->Port = 587; $mail->Username = "user@***.srv.br"; $mail->Password = "passw"; $mail->CharSet = 'windows-1250'; $mail->From = '"user@***.srv.br'; $mail->AddBCC ( 'eduardoxxx@xxxx.com.br', 'xx'); $mail->Subject = $subject; $mail->ContentType = 'text/plain'; $mail->IsHTML(false); $mail->Body = $body_of_your_email; // you may also use $mail->Body = file_get_contents('your_mail_template.html'); $mail->AddAddress ('eduardoxxx@xxxx.com.br', 'Recipients Name'); // you may also use this format $mail->AddAddress ($recipient); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Successfully sent!"; } ?> but i receive this error: SMTP -> ERROR: AUTH not accepted from server: 503 5.5.1 Error: authentication not enabled SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Client host rejected: Access denied SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Client host rejected: Access denied Mailer Error: Language string failed to load: recipients_failededuardoxxxx@xxxx.com.br, [192.168.9.153]>[192.168.9.153]>eduardoxxxx@xxxx.com.br I tried using command line: openssl s_client -starttls smtp -crlf -connect webmail.***.srv.br:587 and it works!!! Why via php i got the error ? In phpinfo: OpenSSL support enabled OpenSSL Version OpenSSL 0.9.8h 28 May 2008 Anyone can help me ? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/293168-send-php-mail-with-ssl/ Share on other sites More sharing options...
Jacques1 Posted December 18, 2014 Share Posted December 18, 2014 Try $mail->SMTPSecure = "tls" instead of $mail->SMTPSecure = "ssl". Quote Link to comment https://forums.phpfreaks.com/topic/293168-send-php-mail-with-ssl/#findComment-1500030 Share on other sites More sharing options...
evop Posted December 21, 2014 Author Share Posted December 21, 2014 Already tried also. It does not work too. Quote Link to comment https://forums.phpfreaks.com/topic/293168-send-php-mail-with-ssl/#findComment-1500254 Share on other sites More sharing options...
jazzman1 Posted December 22, 2014 Share Posted December 22, 2014 (edited) Interesting. What is your real domain name xxxx.com.br or xxxx.srv.br? Is this your domain (webmail.telecel.srv.br) [jazz@centos-box ~]$ nmap --script smtp-open-relay.nse -p 25,465,587 webmail.telecel.srv.br Starting Nmap 5.51 ( http://nmap.org ) at 2014-12-22 07:38 EST Nmap scan report for webmail.telecel.srv.br (177.185.197.65) Host is up (0.20s latency). PORT STATE SERVICE 25/tcp filtered smtp 465/tcp closed smtps 587/tcp closed submission Nmap done: 1 IP address (1 host up) scanned in 2.36 secon if so the ports 465 and 587 are closed. You need to tell us Edited December 22, 2014 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/293168-send-php-mail-with-ssl/#findComment-1500359 Share on other sites More sharing options...
Strider64 Posted December 22, 2014 Share Posted December 22, 2014 try $mail->isSendMail() instead of $mail->isSMTP() - I was having a problem yesterday with my remote server and this fix it. So it might be the problem? An like stated ports 465 or ports 587 need to be commented out $mail->Port = 587. Quote Link to comment https://forums.phpfreaks.com/topic/293168-send-php-mail-with-ssl/#findComment-1500362 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.