Forum Moderators: coopster
I have a variety of possible destinations for a review, depending on who's getting reviewed. I figured that rather than passing the email through the URL string, I'd take a note from TFMail and hardcode the address into the PHP form, and call a different form for each writer. So that's one part, but I'm not sure if that will help deal with the potential spam-use of PHP's basic formmail prog. I did cut out the "send an email to reviewer to confirm" option, so one person can't get spammed a bazillion times.
The second thing is that the formmail prog I first tried (since I may know ASP but I'm a novice at this PHP thing, and the knowledge don't always transfer) sends emails that have a reply address of the name on my main account for each site. I don't want that; I want it coming from a specific address. On one site, I want any replies to bounce, ie, arrive to the writer from a non-existent address; on the other site, I want it to be reply-able to a specific address that will pick up the emails. However, the basic PHP prog results in a from address that says: account@server.hosting-company.com - it doesn't even have my domain name on it. What's up with that?
I did try the bit where I added in the from: section in the mail() string, but all that did was put the "from" address in the body of the email, but the actual from address was still at the top, along with my name.
$headers .= "To: namel@domain.com\n";
$headers .= "From: domain <donotreply@domain.com>\n";
mail($where, "$subject", $message); #"From = $from\nX-Mailer: PHP/" .phpversion());
I commented out the "from = $from..." part because that's what only showed up in the body of the email, and didn't affect the actual from: address. If anyone could recommend a way to adapt the PHP code and complexify it a bit to produce the return address I want, I'd really appreciate it. None of the PHP books I have are much help, and it doesn't seem to be something that most formmail sites ever mention as an option.
- Sol
Welcome to Webmaster World! Below is a plain example of using mail().
mail("recipient@foo.com", "Subject Here", "Message Here", "From: sender@foofoo.com");
Note that each argument of the mail() function is surrounded in quotes. If you put the actual text directly in the mail function you surround it with quotes. If you pre-define each argument to it's own variable, you DO NOT quote it.
Example:
$to = "recipient@foo.com";
$subject = "Subject Here";
$message = "Message Here";
$headers = "From: sender@foofoo.com";
mail($to, $subject, $message, $headers);
Experiment with the above and see if it helps out. I think it will.
Birdman