entropyrising Posted September 9, 2004 Posted September 9, 2004 Ok I'm being driven crazy here. I'm using the mail() function to send html email and it just ain't workin. Something is wrong with the way it is passing the header info. here is the code I'm trying to work. $headers = "From: $mailFrom <$mailFrom>\r\n"; $headers .= "Content-type: text/html\r\n "; mail($mailTo, $mailSubject,$mailBody,$headers); When I try and use this code, the mail does not send, but it doesn't seem to error out in any way either. Now, if I just use the first line of the $headers variable, it will send the email, but the body will not send as html. If I use only the second line of the $headers variable, the mail will send, and the body of the message will be in html format, BUT the from portion of the mail shows up as "Nobody@serverxx.totalChoiceHosting.com I've tried some other routes from other threads in this form. namely http://www.totalchoicehosting.com/forums/i...2648&hl=nobody@ http://www.totalchoicehosting.com/forums/i...l=nobody@server http://www.totalchoicehosting.com/forums/i...3090&hl=nobody@ can anyone shed some light on this? Thanks! Quote
TCH-Bruce Posted September 9, 2004 Posted September 9, 2004 Welcome to the forums. Have you tried Andy's script And not sure if you mistyped this $headers = "From: $mailFrom \r\n"; But it should be $headers .= "From: $mailFrom \r\n"; Note the missing period. Quote
entropyrising Posted September 9, 2004 Author Posted September 9, 2004 Thanks for the quick reply Bruce. the missing period was a typo from my script. I fixed it but unfortunately it didn't fix the problem. Even with the period I don't receive the mail. I've tried Andys script before, but it doesn't seem to send either. just for fun, I tried leaving the variables out of it. $headers .= "From: user <user@domain.net>\r\n"; type thing... no luck there either. Now, i'm kinda a php newbie, so this might be a really retarded question. if you do something like : $headers = "From: $mailFrom <$mailFrom>\r\n\ Content-type: text/html\r\n"; is the newline character still supposed to work? If so, mine doesn't it puts Content-type: text/html along with the email address in the from portion. Quote
entropyrising Posted September 9, 2004 Author Posted September 9, 2004 More weirdness.. Tried using andy's script again, and it works! kinda. If I remove the top line $headers .= "From: $myname <$myemail>\r\n"; it sends the mail with all the other header info, with Nobody in the from box. if I leave the first line, the mail does not send. How about it science? Quote
entropyrising Posted September 9, 2004 Author Posted September 9, 2004 Ok, I understand my problem now. Neomail sucks. LOL I've been using neomail to test this and it does not read the headers right. who'd have thunk huh? Something strange though. I started using neomail about a week ago cause horde was giving me a hard time. Now no mail goes to horde. Any way to get back? Quote
TCH-Bruce Posted September 9, 2004 Posted September 9, 2004 Whoa, you should be able to read your mail in all three webmail clients unless you created folders in Neomail and moved the messages to them. Same with Horde and Squirrel mail. If you have messages in your inbox in one they should also be there in the other two. If that's not the case, please open a help desk ticket link above and have one of the techs take a look. Quote
entropyrising Posted September 10, 2004 Author Posted September 10, 2004 Kudos to TCH for fixing my webmail problem! I can now get mail on all three webclients. You guys are slammin fast. Thanks to you especially Bruce for pointing out the problem and reminding me to raise a ticket. The only bad news is that while using Andy's script works, none of my TCH email accounts seem to pick them up. I have to send to mail accounts outside of TCH for testing. Anyone else have this type of problem? I'm on server17. Thanks! Quote
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.