0

Hi Everyone,

When I feed details in Enquiry Form and click on submit then, my email is not going. It displays error message as "Warning: mail() [function.mail]: SMTP server response: 530 SMTP authentication is required. in E:\HostingSpaces\flashprop\flash-properties.com\wwwroot\sell.php on line 39".

Kindly, help. Thanks in advance.

2
Contributors
10
Replies
13
Views
5 Years
Discussion Span
Last Post by pritaeas
0

The mail function does not support authentication. You'd need to use a tool to do this. Choices can be for example: PHPMailer, SwiftMailer or PEAR::Mail.

0

I used PEAR::Mail for sending mail. Still it is displaying me error message as "Warning: mail() [function.mail]: SMTP server response: 530 SMTP authentication is required. in C:\PHP5\PEAR\Mail\mail.php on line 153". The code is mentioned below: -

<?php
    include('pear_mail/Mail/Mail.php');

    $mail = Mail::factory("mail");

    $headers = array("From"=>"me@example.com", "Subject"=>"Test Mail");
    $body = "This is a test!";
    $mail->send("best@friend.com", $headers, $body);
?> 
0

SMTP server response: 530 SMTP authentication is required

If this is all code, you did not send your authentication (usually email/password).

0

I used PEAR::Mail for sending mail. Still it is displaying me error message as "Warning: mail() [function.mail]: SMTP server response: 530 SMTP authentication is required. in C:\PHP5\PEAR\Mail\mail.php on line 153". The code is mentioned below: -

<?php
    include('pear_mail/Mail/Mail.php');

    $mail = Mail::factory("mail");

    $headers = array("From"=>"me@example.com", "Subject"=>"Test Mail");
    $body = "This is a test!";
    $mail->send("best@friend.com", $headers, $body);
?> 
0
<?php
include('pear_mail/Mail/Mail.php');

$params = array($params["auth"]=>"TRUE","username"=>"admin@mydomain.com","password"=>"xyz");
$mail = Mail::factory("mail",$params);

$headers = array("From"=>"admin@mydomain.com", "Subject"=>"Test Mail");
$body = "This is a test!";
$mail->send("sender@senderdomain.com", $headers, $body);

?>

I modified my code. I added authentication. I created email id for e.g. admin@mydomain.com and I set password for this email id as "xyz". Now, I try sending mail, still it shows same error message "Warning: mail() [function.mail]: SMTP server response: 530 SMTP authentication is required. in C:\PHP5\PEAR\Mail\mail.php on line 156".

Kindly, help me.

0

Try:

$params = array("auth" => true, "username" => "admin@mydomain.com", "password" => "xyz");
$mail = Mail::factory("smtp", $params);

Edited by pritaeas

0
<?php
include('pear_mail/Mail/Mail.php');

$params = array($params["auth"]=>"TRUE","username"=>"admin@mydomain.com","password"=>"xyz");
$mail = Mail::factory("mail",$params);

$headers = array("From"=>"admin@mydomain.com", "Subject"=>"Test Mail");
$body = "This is a test!";
$mail->send("sender@senderdomain.com", $headers, $body);

?>

I modified my code. I added authentication. I created email id for e.g. admin@mydomain.com and I set password for this email id as "xyz". Now, I try sending mail, still it shows same error message "Warning: mail() [function.mail]: SMTP server response: 530 SMTP authentication is required. in C:\PHP5\PEAR\Mail\mail.php on line 156".

Kindly, help me.

0

I tried the above code. But, now its now displaying error message on browser. But, when I echo the result of function i.e. $result = $mail->send("sender@senderdomain.com", $headers, $body);
echo "Result:".$result;

Then, it returns error message as "Result: authentication failure [SMTP: Invalid response code received from server (code: 535, response: Authentication failed. Restarting authentication process.)] ".

Kindly help me out.

0

So the code is now correct, but your mail server is rejecting the authentication. I can't guess what setting that would be.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.