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

krishna
  • 4,069
  • 2
  • 29
  • 56

2 Answers2

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.

Devator
  • 3,686
  • 4
  • 33
  • 52
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.

ajay
  • 1,560
  • 2
  • 13
  • 16