0

i am newbie in php,i want to send email using localhost/xampp and i tried everything but no luck.i tried Change php.ini file ,sendmail, sendmail path,port and cofig my gmail details (gmail id,Password).Done everything mentioned in the tutorials in stackoverflow.

my email code

    $to= '[email protected]';
    $subject = 'the subject';
    $message = 'hello';
    $headers = 'From: [email protected]' . "\r\n" .     'Reply-To: [email protected]' . "\r\n" .     'X-Mailer: PHP/' . phpversion(); 
    $ans = mail($to, $subject, $message, $headers);
    var_dump($ans); 
5
  • Are you trying to send mail to gmail id ? If so, check your spam box of gmail. Commented Jul 2, 2015 at 6:31
  • ya man....but mail not recived Commented Jul 2, 2015 at 6:35
  • i have the same doubt tried everything in that ....but still no luck Commented Jul 2, 2015 at 6:35
  • Not fully sure of what your problem is, but it's worth noting that Gmail requires authentication, thus you cannot use its services with plain mail() funcion. You need a full-fledged third-party mail library. Commented Jul 2, 2015 at 7:12
  • websnippetz.blogspot.in/2013/01/… Commented Dec 5, 2015 at 14:33

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.