28rain Posted February 2, 2009 Share Posted February 2, 2009 Does ANYONES know an smtp which doesnt require a password?? I tried setting up a php mailer but it had errors. So yeah just an smtp which isnt an authenticated. Thanks Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 2, 2009 Share Posted February 2, 2009 What exactly are you trying to do? What is your code and what error did you get with it? For php to be able to send an email, the sending mail server must accept the email. If the sending mail server requires SMTP Authentication, then you will need to provide that. If you attempted to use one of the php mailer classes that supports SMTP authentication and received an error, you would need to post you code and the error for anyone to be able to help you with it. Quote Link to comment Share on other sites More sharing options...
28rain Posted February 2, 2009 Author Share Posted February 2, 2009 Warning: mail() [function.mail]: SMTP server response: 556 CLIENT AUTHENTICATION REQUIRED. USE ESMTP EHLO AND AUTH. in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allinone_form.php on line 44 ok thats the error. i used aol, gmail completly din work. my code is really long and you dont really need 2 see it? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 2, 2009 Share Posted February 2, 2009 The php mail() function does not support SMTP Authentication. It "looks" like an unauthenticated email client and the only mail servers that will accept email directly from the mail() function are ones which have been configured to "trust" the web server where php is running. To use SMTP Authentication you need to use one of the php mailer classes, such as phpmailer, swiftmailer, or pear:mail. http://phpmailer.codeworxtech.com/ http://swiftmailer.org/ http://pear.php.net/package/Mail Quote Link to comment Share on other sites More sharing options...
28rain Posted February 2, 2009 Author Share Posted February 2, 2009 hehe no i have tried mailer and it gave me errors can i not just use and unauthenticated smtp? I dont mind setting up a new address! Could you please tell me an unauthenticated smtp or whatever they are called?! Quote Link to comment Share on other sites More sharing options...
trq Posted February 2, 2009 Share Posted February 2, 2009 If you where using Linux I would suggest setting up ssmtp, but it appears your not so.... Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 2, 2009 Share Posted February 2, 2009 In your other similar thread ( http://www.phpfreaks.com/forums/index.php/topic,230269.0.html ) where you attempted to use the gmail server, you were provided with the same information along with a link to the gmail page that shows the setup information you would need to use. and If you attempted to use one of the php mailer classes that supports SMTP authentication and received an error, you would need to post your code and the error for anyone to be able to help you with it. Quote Link to comment Share on other sites More sharing options...
28rain Posted February 2, 2009 Author Share Posted February 2, 2009 <?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.gmail.com"; // SMTP server $mail->From = "william.kelsey@gmail.com"; $mail->AddAddress("william.kelsey@gmail.com"); $mail->Subject = "First PHPMailer Message"; $mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer."; $mail->WordWrap = 50; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } ?> ok you can have fun finding an error (Message was not sent.Mailer error: The following From address failed: william.kelsey@gmail.com ) im going to contact google! Quote Link to comment Share on other sites More sharing options...
NoPHPPhD Posted February 3, 2009 Share Posted February 3, 2009 install smtp locally, bounce it off of that. you are trying to relay off of smtp server on internet, good luck. Quote Link to comment Share on other sites More sharing options...
corbin Posted February 3, 2009 Share Posted February 3, 2009 28rain, you aren't authenticating to the server. You need: $mail->SMTPAuth = true; $this->Username = 'username'; $this->Password = 'password'; Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 3, 2009 Share Posted February 3, 2009 You also need the port setting - $mail->Port = 465; FYI, in the phpmailer download, docs folder, there is a use_gmail.txt file that shows all the settings you need to use. 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.