The second addressee (pjh@hidden.com) gets an email from the email address that's in $Email, but 4SAM-NJ-subscribe@yahoogroups.com gets one from user "pjh" at the machine that hosts the script!
"We are unable to process the message from <pjh@arkanoid.dreamhost.com>
to <4SAM-NJ-subscribe@yahoogroups.com>."
However, when I send a message from <pjh@arkanoid.dreamhost.com>
to <4SAM-NJ-subscribe@yahoogroups.com> directly, everything works OK.
???
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the email format issue, you must have the mail clients setup differently. This of course depends on what you mean when you say "unable to process the message". This is not very descriptive.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
would you suggest an assignment statement that would give to $FROM the value it needs to present the correct string to mail(), namely From: followed by the email address that's contained in $Email?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is a copy of modifications I made to one of my forms that may help you. The $message piece is shortened for the example. The message can be text only or html as I have done. It is the $headers that you are most interested in. It defines the complete header information you would need to specify a specific "From" address and make the message reciept more consistent by specifically stating the content type. Normally your "From" address is fixed. You want the from address to be from you or your site. It is dangerous to allow form fields to populate the header fields in your mail function without some sort of protection. Do this with caution and protect your forms, and your site, from being used to send spam.
Regardless of the danger, I would like the From: to be the value of the $Email variable. Would you kindly show me how to do that? (I'll take care of the protection once I have some success here.) Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The form HTML file says:
<tr>
<td>Email Address</td>
<td><input name='Email' type=text size="40" /></td>
</tr>
process.php says
....
$message="Email: ".$Email."
Name: ".$Name."
Address: ".$Address."
Phone: ".$Phone."
";
$message = stripslashes($message);
mail("4SAM-NJ-subscribe@yahoogroups.com, pjh@hidden.com","SUBSCRIBE",$message,"From: $Email");
?>
The second addressee (pjh@hidden.com) gets an email from the email address that's in $Email, but 4SAM-NJ-subscribe@yahoogroups.com gets one from user "pjh" at the machine that hosts the script!
"We are unable to process the message from <pjh@arkanoid.dreamhost.com>
to <4SAM-NJ-subscribe@yahoogroups.com>."
However, when I send a message from <pjh@arkanoid.dreamhost.com>
to <4SAM-NJ-subscribe@yahoogroups.com> directly, everything works OK.
???
You can look here for the syntax of th email function.
http://us2.php.net/manual/en/function.mail.php
For the email format issue, you must have the mail clients setup differently. This of course depends on what you mean when you say "unable to process the message". This is not very descriptive.
The problem is that YahooGroups thinks that the sender is pjh@arachnoid.dreamhost.com, not the address that's in $Email
Assuming that the correct syntax is
mail("4SAM-NJ-subscribe@yahoogroups.com, pjh@hidden.com","SUBSCRIBE",$message,$FROM);
would you suggest an assignment statement that would give to $FROM the value it needs to present the correct string to mail(), namely From: followed by the email address that's contained in $Email?
Thanks.
Here is a copy of modifications I made to one of my forms that may help you. The $message piece is shortened for the example. The message can be text only or html as I have done. It is the $headers that you are most interested in. It defines the complete header information you would need to specify a specific "From" address and make the message reciept more consistent by specifically stating the content type. Normally your "From" address is fixed. You want the from address to be from you or your site. It is dangerous to allow form fields to populate the header fields in your mail function without some sort of protection. Do this with caution and protect your forms, and your site, from being used to send spam.
pt_register('POST','Email');
pt_register('POST','SubjectBrokerOrderForm');
$headers = "MIME-Version: 1.0\r\n".
"Content-type: text/html; charset=iso-8859-1\r\n".
"From: \"youraddress@yourdomain.com\"\r\n".
"Date: ".date("r")."\r\n";
$message="
<html>
<body>
<table border=\"1\" width=\"100%\" id=\"table1\">
<tr>
<td width=\"357\"><font face=\"Arial\">
<b>Subject Broker Order Form:</b></font></td>
<td><font face=\"Arial\">
".$SubjectBrokerOrderForm."</font></td>
</tr>
</table>
</body>
</html>
";
$message = stripslashes($message);
mail($Email, "Copy of your order form", $message,$headers);
Regardless of the danger, I would like the From: to be the value of the $Email variable. Would you kindly show me how to do that? (I'll take care of the protection once I have some success here.) Thanks.
$headers = "MIME-Version: 1.0\r\n".
"Content-type: text/html; charset=iso-8859-1\r\n".
"From: ".$Email."\r\n".
"Date: ".date("r")."\r\n";
Thank you!
As far as security goes (and I appreciate your concern), the form is on a password-protected page.