tomfmason Posted July 21, 2006 Share Posted July 21, 2006 I have a register form that I changed alittle bit for a friend. I use a different system for sending mail and am not used to the X-Mailer.here is what I have tried so far[code=php:0] $to = '$email_address'; $subject = 'Your Membership at Settle The Score!'; $message = 'Dear $first_name $last_name, You are now registered at our website, http://www.stsclan.com! To activate your membership, please login here: http://www.stsclan.com/login.php Once you activate your membership, you will be able to login with the following information: <b>Username:</b> <font color=\"#FF0000\">$username</font> <b>Password:</b> <font color=\"#FF0000\">$password</font> Please keep this username and password in a location that is easily accessible by you. Thanks! WebMaster This is an automated response, please do not reply!'; $headers = "From: leader@stsclan.com X-Mailer/PHP phpversion() "; mail($to, $subject, $message, $headers)or die('something went wrong');[/code]and here is another one[code=php:0] $to = '$email_address'; $subject = 'Your Membership at YourSite.com'; $message = 'Dear $first_name $last_name, You are now registered at our website, http://www.yoursite.com! To activate your membership, please login here: http://www.yoursite.com/login.html Once you activate your membership, you will be able to login with the following information: <b>Username:</b> <font color=\"#FF0000\">$username</font> <b>Password:</b> <font color=\"#FF0000\">$password</font> Please keep this username and password in a location that is easily accessible by you. Thanks! WebMaster, YourSite.com This is an automated response, please do not reply!'; $headers = "From: noreply@yoursite.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; mail($to, $subject, $message, $headers)or die('something went wrong');[/code]Like I said I am rather sure that this is a simple problem with a simple fix. Any suggestions would be great. Quote Link to comment https://forums.phpfreaks.com/topic/15280-simple-mail-question/ Share on other sites More sharing options...
kalivos Posted July 21, 2006 Share Posted July 21, 2006 Why did you change the headers?Try this and see if this fixes your problem:[code] $headers = "From: leader@stsclan.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15280-simple-mail-question/#findComment-61758 Share on other sites More sharing options...
tomfmason Posted July 21, 2006 Author Share Posted July 21, 2006 [quote author=kalivos link=topic=101411.msg401328#msg401328 date=1153504798]Why did you change the headers?Try this and see if this fixes your problem:[code] $headers = "From: leader@stsclan.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n";[/code][/quote]That is the same as the second version. The problem iis that it keep displaying the error message [b] Something went wrong[/b]I changed the headers because I assumed that it had to be a problem with the headers. Since he was able to send mail via php before. Quote Link to comment https://forums.phpfreaks.com/topic/15280-simple-mail-question/#findComment-61762 Share on other sites More sharing options...
kalivos Posted July 21, 2006 Share Posted July 21, 2006 I'm not sure what you have tried/done. Have you tried the second version? Does it work? You said "he" was able to send mail via PHP before, why not use the same script? Or is it the same script and did it just stop working? I'm affraid I can't be of much help without some info. Quote Link to comment https://forums.phpfreaks.com/topic/15280-simple-mail-question/#findComment-61765 Share on other sites More sharing options...
tomfmason Posted July 21, 2006 Author Share Posted July 21, 2006 he was able to send mail via php before but has since erased the file that he sent mail with. If that were the case I would have just compared the two and changed what need to be changed. I have tried both of the examples that I have posted. I am starting to think that it is the formaton of my headers. I am going to try something like this[code=php:0] $headers = "From: whatever@whatever.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=utf-8\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n\r\n";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15280-simple-mail-question/#findComment-61767 Share on other sites More sharing options...
kalivos Posted July 21, 2006 Share Posted July 21, 2006 This just hit me... Try the following:[code] $to = $email_address; $subject = 'Your Membership at Settle The Score!'; $message = "Dear ".$first_name." ".$last_name.", You are now registered at our website, http://www.stsclan.com! To activate your membership, please login here: http://www.stsclan.com/login.php Once you activate your membership, you will be able to login with the following information: <b>Username:</b> <font color=\"#FF0000\">".$username."</font> <b>Password:</b> <font color=\"#FF0000\">".$password."</font> Please keep this username and password in a location that is easily accessible by you. Thanks! WebMaster This is an automated response, please do not reply!"; $headers = "From: leader@stsclan.com\r\n MIME-Version: 1.0\r\n Content-Type: text/html; charset=utf-8\r\n Content-Transfer-Encoding: 8bit\r\n\r\n"; mail($to, $subject, $message, $headers)or die('something went wrong');[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15280-simple-mail-question/#findComment-61772 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.