PHP2005 Posted September 5, 2007 Share Posted September 5, 2007 I am working on a form and it is working well, but when try to add the following line: $mailto .= .$sub_email. ; it is not working right because what I am trying to do is for the person who had submitted the form to get a copy of their submittion. Advance thanks. I am using php code as follows: <?php $mailto = '[email protected]' . ', ' ; $mailto .= .$sub_email. ; $subject="E-mail Page"; $formurl="formula.php"; $errorurl="mailerror.php"; $thankyouurl="ThankYou.php"; $YES = $_POST[YES]; $Name = $_POST[Name]; $sub_email = $_POST[sub_email]; $Phone = $_POST[Phone]; $Mailing_address = $_POST[mailing_address]; $City = $_POST[City]; $State = $_POST[state]; $Zip_Code = $_POST[Zip_Code]; $messagetext = 'Email Testing'; mail($mailto, $subject, $messagetext, "From: "$Name" <$email>nReply-To: "$sub_email" <$email>nXMailer: chfeedback.php 2.01"); header("Location: $thankyouurl"); exit; ?> Link to comment Share on other sites More sharing options...
dreamingmind Posted September 5, 2007 Share Posted September 5, 2007 php2005, As far as I know, the line should read $mailto .= $sub_email; enclosing the variable name in the '.' concatenation operator appears to be incorrect. Later in the code, the indexes into the $_POST array are not enclosed in quotes. This would be correct if those are constants, but... Regards, Don Link to comment Share on other sites More sharing options...
PHP2005 Posted September 6, 2007 Author Share Posted September 6, 2007 Don, Thank you for the help. It did work but for some reason the e-mail only comes to me if I use the in house e-mail account. For example in my web form I type [email protected] at the field $sub_email I do not get any e-mail at my yahoo account, but if in case I type the inhouse e-mail account at $sub_email it will show at my e-mail account. Do you have any idea what can be the problem? thank you Link to comment Share on other sites More sharing options...
dreamingmind Posted September 6, 2007 Share Posted September 6, 2007 php2005, So, if you enter a your inhouse email at $sub_email so that $mailto becomes [email protected], [email protected] you will receive two emails. If you only receive one, then the problem is with concatenating the second address; but if you provide values so that $mailto becomes [email protected], [email protected] you only receive mail at scm1m2m3? I'm not sure what could be going on here. These are some thoughts: Are you certain the 2nd address is working and is correct. Try a 3rd address. If you put the second address in $mailto all by itself does it work? What happens if you assign values so that $mailto becomes [email protected], [email protected] ? regards, Don Link to comment Share on other sites More sharing options...
PHP2005 Posted September 6, 2007 Author Share Posted September 6, 2007 I did try to use an hotmail, gmail, or yahoo e-mail account and none of them went to my account. I did try also to use $mailto='[email protected]' and did not work. I tried also but didn't work. $foo='[email protected]'; $mailto=$foo; any idea? Link to comment Share on other sites More sharing options...
PHP2005 Posted September 6, 2007 Author Share Posted September 6, 2007 I also tried to use $mailto ="inhouse email account".','.$sub_email; but only went to the inhouse e-mail account and not to the yahoo account Link to comment Share on other sites More sharing options...
dreamingmind Posted September 6, 2007 Share Posted September 6, 2007 If you send to [email protected], [email protected] do you get two messages? Don Link to comment Share on other sites More sharing options...
dreamingmind Posted September 6, 2007 Share Posted September 6, 2007 Assuming you DO get two message in the last example, it sounds a bit like there is some problem sending mail to domains other than your inhouse domain. This is not an area I'm knowledgeable in. Do you have an inhouse IT department that manages your servers? They may be able to explain why you can send to your local domain and not an external domain. Regards, Don Link to comment Share on other sites More sharing options...
PHP2005 Posted September 6, 2007 Author Share Posted September 6, 2007 I only get one message Link to comment Share on other sites More sharing options...
dreamingmind Posted September 6, 2007 Share Posted September 6, 2007 well, i guess the one message thing is no problem. I tested here and get the same result to a dup address. I'm thinking its a problem with the server being able to handle external email addresses. Sorry I couldn't be more help Regards, Don Link to comment Share on other sites More sharing options...
PHP2005 Posted September 6, 2007 Author Share Posted September 6, 2007 Don, Thank you so much for your help. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6240 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now