almightyegg Posted October 19, 2007 Share Posted October 19, 2007 I have this: $subject = "Your Account!"; $message = "Thank you for signing up for an account! Here are your details, make sure you don't lose them!\n\nEmail: $email\nPassword: $password\n\nPlease don't reply directly to this email, it is an automated response."; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail($email, $subject, $message); and email is defined for sure as it has to go through checks (which I know work). I have no idea what's wrong with it Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/ Share on other sites More sharing options...
Wes1890 Posted October 19, 2007 Share Posted October 19, 2007 ^ Does your server support mailing? Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373138 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 Well, I used to have it sending something else, whih worked then I changed it today because I wanted it to send details rather than links for activations of accounts because I'm scrapping that. Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373149 Share on other sites More sharing options...
Wes1890 Posted October 19, 2007 Share Posted October 19, 2007 Well that code looks good to me.. so there error must be outside of that Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373161 Share on other sites More sharing options...
brettpower Posted October 19, 2007 Share Posted October 19, 2007 I noticed that you don't have $email and $password defined although you are calling those variables in the script. Are they defined well before this code? Just a thought since I can't see them. Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373164 Share on other sites More sharing options...
brettpower Posted October 19, 2007 Share Posted October 19, 2007 I can't see anything wrong with your code. Check higher up in the page before this email code to see if another script or other bit of code is throwing things off a bit. Can you post more of your pages code? Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373171 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Do you get $email variable from a $_POST or $_GET? Try defining it statically right before you use mail() Also send it to your domain email account, if you are using Yahoo or Hotmail it may go to a Spam folder. Are you on a virtual host account? Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373173 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 $password and $email are set for sure, they are put into the database a few line up. Here is more of my code: $sql = mysql_query("INSERT INTO users (first, last, email, username, password, signup_date, ip, gender, lastlogin, country, race, psyche) VALUES('$first', '$last', '$email', '$username', '$password', '$sign', '$ip', '$gender', '$time', '$country', '$race', '$psyche')") or die (mysql_error()); if(!$sql){ echo 'There has been an error creating your account. Please contact the <a href="mailto:[email protected]">administrator</a> if this continues to happen.'; } else { $subject = "Your Account!"; $message = "Thank you for signing up for an account! Here are your details, make sure you don't lose them!\n\nEmail: $email\nPassword: $password\n\nPlease don't reply directly to this email, it is an automated response."; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail($email, $subject, $message); echo "Your account information has been mailed to your email address! It's recommended that you keep it saved. You may now <a href='/index.php'>Login!</a>"; } Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373178 Share on other sites More sharing options...
brettpower Posted October 19, 2007 Share Posted October 19, 2007 Echo your queries to see if the variables are successfully being passed. Oh, and try backing out the change you made and revert to what it was when it worked. That might help you narrow things down a bit. Since it was working before logic would suggest it is in the code. Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373181 Share on other sites More sharing options...
brettpower Posted October 19, 2007 Share Posted October 19, 2007 Do you get $email variable from a $_POST or $_GET? Try defining it statically right before you use mail() Also send it to your domain email account, if you are using Yahoo or Hotmail it may go to a Spam folder. Are you on a virtual host account? Believe me, this is very common! There were times where I spend hours banging my head on my desk when spam filters were the sole cause. Have you been sending a lot of test messages? If so, how far apart were they? Too many messages in a short time frame can get you blocked. Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373185 Share on other sites More sharing options...
heathergem Posted October 19, 2007 Share Posted October 19, 2007 Have you been sending a lot of test messages? If so, how far apart were they? Too many messages in a short time frame can get you blocked. I have the same problem, and this must be what happened to me. I sent out all kinds of tests. How do I get "unblocked"? Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373187 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 Your Account! Thank you for signing up for an account! Here are your details, make sure you don't lose them! Email: [email protected] Password: mypass Please don't reply directly to this email, it is an automated response. That's what I got when echoing, which was correct, but it still didn't send... Maybe I need to use a function? It wouldn't send it because of the $variables...? Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373195 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Google maybe blocking your emal address because the email on virtual hosts is sent by email server domain which is not matched with mail() headers. Try using this $subject = "Your Account!"; $message = "Thank you for signing up for an account! Here are your details, make sure you don't lose them!\n\nEmail: $email\nPassword: $password\n\nPlease don't reply directly to this email, it is an automated response."; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail($email, $subject, $message, "-f $email"); After I added "-f $email" I was able to send mail. Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373205 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 I forget the function with when used shows you what is installed on server. They migh have uninstalled it recently... Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373215 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 phpinfo(); Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373254 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 I couldn't find anything to do with mail there...dammit Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373259 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Take a look if local and master value for sendmail_path is defined when runing phpinfo() Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373273 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373282 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Looks good to me, so it instaled. Try putting the -f handle, I also had the same proble, all of the souden it stoped working, but after I put it worked fine. Try sending an email to your domain email addrress not to Google mail and see if you recieve it. Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373291 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 It works on my domain but not on googlemail... It isn't in my spam, I've checked and double checked... Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373352 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Try the fix I recomnded to you using the -f handle, and if it does not work you will neeed to instal sourceforge mail library that will use SMTP when sending email not send mail. This way the mail will be identified as coming from your domain not hosting provider server doamin, that is why Google is blocking it because it thinks it is Spam... Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373378 Share on other sites More sharing options...
almightyegg Posted October 19, 2007 Author Share Posted October 19, 2007 I already changed it to this: mail($email, $subject, $message, "-f $email"); Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373392 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Okay so if this does not work take a look at sourceforge SMTP script library. Do a search in the forum there should be a link to the script. Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373397 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Here is the link. http://phpmailer.sourceforge.net/ Link to comment https://forums.phpfreaks.com/topic/73949-another-person-with-mail-problems/#findComment-373403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.