Jump to content

[SOLVED] Smtp with no authentication?


28rain

Recommended Posts

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.

Link to comment
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?

Link to comment
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

Link to comment
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.

Link to comment
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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.