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); Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
teng84 Posted August 30, 2007 Share Posted August 30, 2007 hehe not clear enough Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted August 30, 2007 Share Posted August 30, 2007 try combining arguements *nod* Quote Link to comment 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. Quote Link to comment 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]; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.