steelerman99 Posted July 20, 2008 Share Posted July 20, 2008 Hey all! I'm getting an error when I send an HTML email Warning: mail() [function.mail]: SMTP server response: 503 5.5.0 need RCPT before DATA in .... Does anyone know what this is caused by? Here is my section of code that sends email: //($sendmailaddrs populated by a query earlier in code) $mymessage = <<<HERE <html> <body> <b><u><h2 align = 'center'>*****GAME ADDED TO YOUR SCHEDULE******</h2></u></b> <p> A game has been added to your schedule on $theday $fancydate: </p> <table border = '1'> <tr bgcolor = '#FF0000'><td><u><b><i>LEAGUE:</i></u></b></td> <td><u><b><i>$uschedule</u></b></i></td></tr> <tr><td><b>DATE:</b></td> <td>$theday $fancydate</td></tr> <tr><td><b>TIME:</b></td> <td>$time</td></tr> <tr><td><b>AWAY:</b></td> <td>$away</td></tr> <tr><td><b>HOME:</b></td> <td>$home</td></tr> <tr><td><b>FIELD:</b></td> <td>$field</td></tr> <tr><td><b>UMP1:</b></td> <td>$ump1</td></tr> <tr><td><b>UMP2:</b></td> <td>$ump2</td></tr> <tr><td><b>STATUS:</b></td> <td>$status</td></tr> </table> <p> <b>ASSIGNOR COMMENTS:</b> $comments </p> <p> Please confirm your receipt of this notification by replying to this email. </p> <p> If you have any questions, please contact the assignor of this game by phone or at $assaddr. </p> </body> </html> HERE; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: $sendmailaddrs' . "\r\n"; if(mail($sendmailaddrs,'GAME ADDED on $theday $fancydate',$mymessage,$headers)) print"<br/>Mail sent to <b>$sendemailnames</b> at <b>$sendemailaddrs</b><br/>"; else print"<br/><b>ERROR:</b> Mail not successfully sent to <b>$sendemailnames</b> at <b>$sendemailaddrs</b>"; Thanks! Link to comment https://forums.phpfreaks.com/topic/115717-error-sending-html-email/ Share on other sites More sharing options...
steelerman99 Posted July 24, 2008 Author Share Posted July 24, 2008 have any ideas on what would cause this? thanks! Link to comment https://forums.phpfreaks.com/topic/115717-error-sending-html-email/#findComment-598956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.