mcmuney Posted August 29, 2007 Share Posted August 29, 2007 Problem: When email goes out, $from appears To, $email appears under Subject and actual From is blank. I tried modifying the Mail Function by removing $from, but then no email goes out. Any thoughts here??? Ideally $myemail should work as From, $email as To Include File function sendmail($fto,$fsub,$fbody,$ffrom) { $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From:<$ffrom>\r\n"; @mail($fto, $fsub, $fbody,$headers); } Mail Function $db->sendmail($from,$email,$subject,$mail_body,$myemail); Link to comment https://forums.phpfreaks.com/topic/67218-sendmail-problem/ Share on other sites More sharing options...
mcmuney Posted August 30, 2007 Author Share Posted August 30, 2007 Any help on this? Anybody? Bueller? Did I not express the problem correctly? Link to comment https://forums.phpfreaks.com/topic/67218-sendmail-problem/#findComment-338027 Share on other sites More sharing options...
teng84 Posted August 30, 2007 Share Posted August 30, 2007 hehe not clear enough Link to comment https://forums.phpfreaks.com/topic/67218-sendmail-problem/#findComment-338029 Share on other sites More sharing options...
Jessica Posted August 30, 2007 Share Posted August 30, 2007 Well look at the arguments you're sending and what you expect. You expect: sendmail($fto,$fsub,$fbody,$ffrom) = FOUR arguments. You send: $db->sendmail($from,$email,$subject,$mail_body,$myemail); // FIVE. Link to comment https://forums.phpfreaks.com/topic/67218-sendmail-problem/#findComment-338032 Share on other sites More sharing options...
darkfreaks Posted August 30, 2007 Share Posted August 30, 2007 try combining arguements *nod* Link to comment https://forums.phpfreaks.com/topic/67218-sendmail-problem/#findComment-338037 Share on other sites More sharing options...
mcmuney Posted August 31, 2007 Author Share Posted August 31, 2007 Well look at the arguments you're sending and what you expect. You expect: sendmail($fto,$fsub,$fbody,$ffrom) = FOUR arguments. You send: $db->sendmail($from,$email,$subject,$mail_body,$myemail); // FIVE. Well, I tried $db->sendmail($email,$subject,$mail_body,$myemail);, but when I do this, no email goes out. Link to comment https://forums.phpfreaks.com/topic/67218-sendmail-problem/#findComment-338155 Share on other sites More sharing options...
mcmuney Posted August 31, 2007 Author Share Posted August 31, 2007 I've modified the code somewhat to be: $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From:<$myemail>\r\n"; mail($email, $subject, $mail_body, $headers); $email seems to be the problem (if I replace $email with a single email address, it works, if I move $email in the subject spot, it sends all emails to single to address with email being displayed in the subject header), so the problem is $email in the to spot, any ideas? $arremail = explode(",",$to); for($i=0;$i<count($arremail);$i++) { $email = $arremail[$i]; Link to comment https://forums.phpfreaks.com/topic/67218-sendmail-problem/#findComment-338426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.