Jump to content
xisto Community
Sign in to follow this  
galexcd

Sending PHP mail with mail() function issue mail function

Recommended Posts

I have pretty much deleted a page with over 700 lines of code in it trying to find what was wrong with it, and it still wont work. I also tried on a new page. mail("my email", "Test", "Test");DOSNT WORK!!!mail("my email", "Test", "Test","From: my email@myhost.com);DOSNT WORK!!!if(mail("my email", "Test", "Test")){echo "it worked";}RETURNS "it worked", BUT IT STILL DOSNT WORK!!!WHAT THE HELL IS WRONG.. IM ABOUT TO KILL MYSELF :):(:( AHHHHHHHHHH!!!!!

Share this post


Link to post
Share on other sites

Try out the following example.

<?php /* recipients */ $to  = "mary@example.com" . ", "; // note the comma $to .= "kelly@example.com"; /* subject */ $subject = "Birthday Reminders for August"; /* message */ $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr>  <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr>  <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr>  <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> '; /* To send HTML mail, you can set the Content-type header. */ $headers  = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; /* additional headers */ $headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n"; $headers .= "From: Birthday Reminder <birthday@example.com>\r\n"; $headers .= "Cc: birthdayarchive@example.com\r\n"; $headers .= "Bcc: birthdaycheck@example.com\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); ?>

Secondly, Make sure, your headers are properly sent because you might get banned by other mail companies.

Also, the user who was suspended was sending THOUSANDS of emails were SPAM! We will not suspend anyone without a genuine reason. We have log records and complaints. Refrain from jumping onto any conclusions. :-)

Share this post


Link to post
Share on other sites

Also, the user who was suspended was sending THOUSANDS of emails were SPAM! We will not suspend anyone without a genuine reason. We have log records and complaints. Refrain from jumping onto any conclusions. :-)

Yeah... thanks, just making sure. :)


Try out the following example.

<?php /* recipients */ $to  = "mary@example.com" . ", "; // note the comma $to .= "kelly@example.com"; /* subject */ $subject = "Birthday Reminders for August"; /* message */ $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr>  <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr>  <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr>  <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> '; /* To send HTML mail, you can set the Content-type header. */ $headers  = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; /* additional headers */ $headers .= "To: Mary <mary@example.com>, Kelly <kelly@example.com>\r\n"; $headers .= "From: Birthday Reminder <birthday@example.com>\r\n"; $headers .= "Cc: birthdayarchive@example.com\r\n"; $headers .= "Bcc: birthdaycheck@example.com\r\n"; /* and now mail it */ mail($to, $subject, $message, $headers); ?>

Still wont work, i tried 2 different e-mail adresses. Nothing. My original code worked two days ago, but when i tried it yesterday it didn't work... and i never changed the code. Could the outgoing mail server be broken? I knowticed my mail cliant cant connect to the outgoing mail server for my Xisto - Web Hosting account.. :(

Secondly, Make sure, your headers are properly sent because you might get banned by other mail companies.


Um... what should i set my headers to so i dont get banned from other email companies?

Share this post


Link to post
Share on other sites
Cannot send and receive email from localhost website.Sending PHP mail with mail() function issue

Hi,

I'm a newbie to develop a reminder send mail system. Now I have create a send mail system for my website but I cannot successfully send email from my website to others through their email address. I develop my website using AppServ software which include php, apache and sql. I have change the smtp and smtp-port in php.ini file to smtp.Streamyx.Com and 25. But I still cannot send out the email to other domains.I really need some solutions for this. Please help me..-question by annie

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.