ozman26 Posted April 27, 2010 Share Posted April 27, 2010 Hi Guys, I have a small problem which I cannot figure out, but taking my chances with you here. I have the same php script installed on my laptop and on a desktop. If it runs from the laptop, mail goes out and received. If I send it from the desktop, I get a SMTP Error: Could not authenticate notification along with Warning: Cannot modify header information - headers already sent ..... Below is part of the script. Can someone shed some light why one would work and not the other if both are configured the same. Thank-you in advance. require("class.phpmailer.php"); $mail=new PHPMailer(); $mail->IsSMTP(); $mail->Host = "smtphm.XXXXXX.XX"; $mail->SMTPAuth = true; $mail->Username = "XXX"; $mail->Password = "XXXX"; $mail->From = "webmaster@XXXX.XX"; $mail->FromName ="XXXXX"; $mail->AddAddress("$feedbackemail","$feedbackname"); $mail->WordWrap = 50; $mail->IsHTML(true); I also put in $mail->SMTPDebug = 2; to see the actual message and this is what he provides me. SMTP -> FROM SERVER:220 BLU0-SMTP73.blu0.hotmail.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Mon, 26 Apr 2010 18:22:40 -0700 SMTP -> FROM SERVER: 250-BLU0-SMTP73.blu0.hotmail.com Hello [70.31.211.52] 250-TURN 250-SIZE 35840000 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING 250-VRFY 250-TLS 250-STARTTLS 250 OK SMTP -> ERROR: AUTH not accepted from server: 530 5.7.0 Must issue a STARTTLS command first SMTP -> FROM SERVER:530 5.7.0 Must issue a STARTTLS command first SMTP -> ERROR: RSET failed: 530 5.7.0 Must issue a STARTTLS command first SMTP Error: Could not authenticate. My ISP requires authentication now, but didn't before. the mail() command was working fine. As mentioned, the laptop contains the same script and it works flawlessly. I've checked high and low but cannot figure out what to do. Thank you in advance. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 27, 2010 Share Posted April 27, 2010 STARTTLS The php openssl extension must be enabled to allow php to connect to the mail server using the https protocol. Quote Link to comment Share on other sites More sharing options...
ozman26 Posted April 27, 2010 Author Share Posted April 27, 2010 the openssl extension is enabled in php.ini?? still provides error. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 27, 2010 Share Posted April 27, 2010 Yes, but is it actually being loaded? What does a phpinfo(); statement show? There should be a whole section listed (not to be confused with any openssl listed for your web server) - openssl OpenSSL support enabled OpenSSL Library Version OpenSSL 0.9.8k 25 Mar 2009 OpenSSL Header Version OpenSSL 0.9.8l 5 Nov 2009 Quote Link to comment Share on other sites More sharing options...
ozman26 Posted April 27, 2010 Author Share Posted April 27, 2010 phpinfo() says OpenSSL support enabled OpenSSL Version OpenSSL 0.9.8e 23 Feb 2007 Quote Link to comment Share on other sites More sharing options...
ozman26 Posted April 27, 2010 Author Share Posted April 27, 2010 Openssl is activated, still a no go. Getting. Now what? SMTP -> FROM SERVER:220 BLU0-SMTP47.blu0.hotmail.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Mon, 26 Apr 2010 19:39:20 -0700 SMTP -> FROM SERVER: 250-BLU0-SMTP47.blu0.hotmail.com Hello [70.31.211.52] 250-TURN 250-SIZE 35840000 250-ETRN 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-8bitmime 250-BINARYMIME 250-CHUNKING 250-VRFY 250-TLS 250-STARTTLS 250 OK SMTP -> ERROR: AUTH not accepted from server: 530 5.7.0 Must issue a STARTTLS command first SMTP -> FROM SERVER:530 5.7.0 Must issue a STARTTLS command first SMTP -> ERROR: RSET failed: 530 5.7.0 Must issue a STARTTLS command first SMTP Error: Could not authenticate. Quote Link to comment Share on other sites More sharing options...
cags Posted April 28, 2010 Share Posted April 28, 2010 I don't believe you actually need openssl enabled in order to use TLS only for SSL. It's awhile since I've use phpMailer, but have you tried using... $mail->SMTPSecure = "tls" Quote Link to comment Share on other sites More sharing options...
ozman26 Posted April 28, 2010 Author Share Posted April 28, 2010 Thanks cags, That did the trick, however I had to re-install Apache/PHP5/MySQL for it to work. Strange that the laptop I did not have to use $mail->SMTPSecure = "tls" but on the actual server I did. The only difference I see between the laptop and the server is the OS. Laptop = Vista and the Server = WinXP SP2. As long as it works I'm okay, but I'd still like to know if this is what caused it in the first place. Thanks to all for you help. Quote Link to comment 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.