shrayyef1790 Posted March 17, 2012 Share Posted March 17, 2012 i'm running php 5.3 in wamp server with windows xp sp3 <?php $Name = "my name"; //senders name $email = "[email protected]"; //senders e-mail adress $recipient = "[email protected]"; //recipient $mail_body = "The text for the mail..."; //mail body $subject = "Subject for reviever"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields ini_set('sendmail_from', '[email protected]'); //Suggested by "Some Guy" ini_set('SMTP', 'smtp.gmail.com'); //Suggested by "Some Guy" ini_set('smtp_port', 465); //Suggested by "Some Guy" $result = mail($recipient, $subject, $mail_body, $header); //mail command return $result; ?> some one help me please Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/ Share on other sites More sharing options...
scootstah Posted March 17, 2012 Share Posted March 17, 2012 You need to have a mail server configured to send mail. Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/#findComment-1328371 Share on other sites More sharing options...
shrayyef1790 Posted March 17, 2012 Author Share Posted March 17, 2012 i used php mailer and still not working Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/#findComment-1328558 Share on other sites More sharing options...
scootstah Posted March 17, 2012 Share Posted March 17, 2012 You still need a mail server. Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/#findComment-1328559 Share on other sites More sharing options...
shrayyef1790 Posted March 17, 2012 Author Share Posted March 17, 2012 can you suggest one please ? Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/#findComment-1328562 Share on other sites More sharing options...
Pikachu2000 Posted March 17, 2012 Share Posted March 17, 2012 I see you're attempting to send through Gmail. Google's SMTP servers require authentication. PHP's mail() function doesn't provide the ability to authenticate. Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/#findComment-1328563 Share on other sites More sharing options...
shrayyef1790 Posted March 19, 2012 Author Share Posted March 19, 2012 Pikachu2000 how can i fix Authentication problem i just want to note that i'm a new to php and i'm still learning Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/#findComment-1329134 Share on other sites More sharing options...
Pikachu2000 Posted March 19, 2012 Share Posted March 19, 2012 If you need authentication, you'll need to use a third party class such as phpmailer, or PEAR::MAIL. Link to comment https://forums.phpfreaks.com/topic/259116-problem-with-php-mail/#findComment-1329145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.