0

Is there any way in php or javascript to send mail without passwords. I need to send mail without asking for his passwords. Please help me finding the solution.

Thanks in advance.

EDIT

this the code i tried

<?php

 error_reporting(E_ALL);
$to = "person2@gmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "person2@gmail.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers) or die("errors");
echo "Mail Sent.";
?>

and it displays errors as o/p and not sending mail

4

2 回答 2

0

With PHP you can just use the mail() function, this does not require the user to enter his/her password.

The SMTP server can be set in php.ini.

于 2013-02-08T12:15:44.337 回答
0

you can refer below link for this

http://www.w3schools.com/php/php_mail.asp

mail() function does not work on localhost so check this on server.

于 2013-02-08T14:01:28.380 回答