Jump to content

Archived

This topic is now archived and is closed to further replies.

28rain

[SOLVED] Smtp with no authentication?

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?!

Share this post


Link to post
Share on other sites

If you where using Linux I would suggest setting up ssmtp, but it appears your not so....

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

<?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!

Share this post


Link to post
Share on other sites

install smtp locally, bounce it off of that. you are trying to relay off of smtp server on internet, good luck.

Share this post


Link to post
Share on other sites

28rain, you aren't authenticating to the server.  You need:

 

 

$mail->SMTPAuth = true;

$this->Username = 'username';

$this->Password = 'password';

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.