Jump to content

sending mail() but failing


MarioApprentice

Recommended Posts

Hey everyone.

 

The mail() function wont send mail(). The return value is true, but the mail wasn't received.

 

That was the first thing i tried. The second was the Mail.php from PEAR, mainly sending mail from gmail but that also didn't work. I didn't even want to upload the files from it. When I put a require_once(Mail.php), nothing happens and my program crashes with no warning or errors. Just a blank white screen. I've tried a lot of links from the google. Some of them are

http://stackoverflow.com/questions/712392/send-email-using-gmail-smtp-server-from-php-page

read this->

http://www.askapache.com/php/phpfreaks-eric-rosebrocks-phpmailer-tutorial.html

https://forums.digitalpoint.com/threads/how-to-use-gmail-to-send-emails-in-php-using-phpmailer.871893/

 

when using other libraries like phpmailer or Mail.php from Pear, i tried everything i could think of. Changing prot from 465 to 25 even though its the default in phpmailer, changing stmp.gmail.com or ssl://smtp.gmail.com, messing with the phpmailer scripts and other things but nothing didn't help.

 

Ive gone through many tutorials about phpmailer and Mail from Pear but couldn't make it happen. Eventualy, when all of it didn't work, i came back to php mail() function.

This is the code... Thank you in advance for every help you give me.

 

$to = '[email protected]';
$subject = 'The subject';
$message = 'Some message';
$headers = 'From: [email protected]' // and other like reply-to and so on...

mail($to, $subject, $message, $headers);

 

Link to comment
https://forums.phpfreaks.com/topic/275670-sending-mail-but-failing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.