Search code examples
phpemailpasswordssmtp-auth

send mail without passwords


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 = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$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


Solution

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