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 = 'emalToSend@gmail.com';
$subject = 'The subject';
$message = 'Some message';
$headers = 'From: me@gmail.com' // and other like reply-to and so on...

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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