dklbwf Posted October 29, 2009 Share Posted October 29, 2009 Hello PHP Family, I am basically having a issue with my confirmation email function, where when a member signs up on my site they do indeed receive a confirmation email but the body is not displaying. What's weird is it shows in gmail only with no problems at all...i have tried aol, yahoo, & hotmail and all 3 email addresses recieve blank confirmation emails....could my mail.php file be off somewhere or what else could it be??? I'm totally lost, not sure if its the mail.php file you want to see but if so here it is: <? $ntm3k_ncd_directive=$do_not_change; function send_html($from, $to, $subject, $text, $html) { global $debug; if ($debug) echo "<HR>DEBUG|From:$from|To:$to|Subject:$subject<HR>$text<HR>$html<HR>"; $headers = "From: $from\r"; $headers .= "Reply-To: $from\r"; $headers .= "X-Mailer: PHP/" . phpversion()."\r"; $headers .= "MIME-Version: 1.0\r"; $boundary = uniqid("MAB"); $headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\r"; $headers .= "$text\r\r"; $headers .= "--$boundary\r" . "Content-Type: text/plain; charset=ISO-8859-1\r" . "Content-Transfer-Encoding: base64\r\r"; $headers .= chunk_split(base64_encode("$text")); $headers .= "--$boundary\r" . "Content-Type: text/html; charset=ISO-8859-1\r" . "Content-Transfer-Encoding: base64\r\r"; $headers .= chunk_split(base64_encode("$html")); mail($to, $subject, "", $headers); } function parse_mail($mail, $param) { foreach ($param as $key=>$val) $mail=str_replace("#".$key."#",$val,$mail); return $mail; } ?> Thanks For Any Help N Advance!! Link to comment https://forums.phpfreaks.com/topic/179506-email-confirmation-body-is-not-displaying-in-emails/ Share on other sites More sharing options...
Altec Posted October 29, 2009 Share Posted October 29, 2009 Use phpMailer. Link to comment https://forums.phpfreaks.com/topic/179506-email-confirmation-body-is-not-displaying-in-emails/#findComment-947220 Share on other sites More sharing options...
jonsjava Posted October 29, 2009 Share Posted October 29, 2009 Altec said it best. phpMailer is a great solution for handling mail being sent out. If you need help with setting it up, either post here (because you didn't begin with questions regarding how to send e-mail with phpMailer, I don't think anybody will hold it against you for asking questions about something we pointed you to), or send me a PM. Link to comment https://forums.phpfreaks.com/topic/179506-email-confirmation-body-is-not-displaying-in-emails/#findComment-947228 Share on other sites More sharing options...
dklbwf Posted October 29, 2009 Author Share Posted October 29, 2009 Thanks so much for responding....Im rather new to php and not sure what php mailer is...basically i purchased a php script program and i had to do was put on my server which i have done, everything is working great so far except for this confirmation email part....i just put in php mailer in google which took me to a download page on soundforge, i downloaded the zip file named PHPMAILER_v5.1.zip..not sure where to go from here Thanks For Any Help!! Link to comment https://forums.phpfreaks.com/topic/179506-email-confirmation-body-is-not-displaying-in-emails/#findComment-947271 Share on other sites More sharing options...
jonsjava Posted October 29, 2009 Share Posted October 29, 2009 why oh why didn't I see it before: mail($to, $subject, "", $headers); You don't HAVE a body to your text. I wish I would have been the headers missing, seeing how close it is to Halloween and all... Link to comment https://forums.phpfreaks.com/topic/179506-email-confirmation-body-is-not-displaying-in-emails/#findComment-947279 Share on other sites More sharing options...
dklbwf Posted October 29, 2009 Author Share Posted October 29, 2009 I think they left it blank becuase something else is being pulled to fill the body.....when i go to my gmail account this is the message i get: Dear User ! Thank you for registering in our system. Now you should go the link below to activate your membership account: http://www.domain.com/confirm.php?mid=salley&stamp=1256837424 Your username is: salley Your password is: password But all the other email platforms display blank body messages????? Do you think i need to somehow figure out how to bring that confirm address into that area you are saying is blank??? Thanks!! Link to comment https://forums.phpfreaks.com/topic/179506-email-confirmation-body-is-not-displaying-in-emails/#findComment-947289 Share on other sites More sharing options...
cags Posted October 29, 2009 Share Posted October 29, 2009 The method the OP is using is inserting the body text using the headers, which is perhaps producing an only partly valid e-mail. I don't know enough about valid e-mail structure to say for sure. But as jonsjava points out, the easiest solution would probably be to remove the body text from the header and use the actual message body parameter. Link to comment https://forums.phpfreaks.com/topic/179506-email-confirmation-body-is-not-displaying-in-emails/#findComment-947307 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.