FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Using PHP's built in mail() to modify the from attribute.





cr3ativ3
Hi, I was working on a feed back form that won't necessarily have me getting the email from it. The people that would be getting it aren't that good with computers so it may be terribly complicated to the to take the email address in an email and create a new email or reply to the existing email while imputing the new email into the address box.

So, I was wondering if there was a way to modify the from attribute for sending an email from php so instead of having. Some server email address as the email address they would respond to when they press respond it would respond using a collected email address from the form.

I was wondering if this is possible with php without having to connect to the email addresses server. I guess I don't really need it to be sent from the users email but more or less cloak the email with the users email they provide in the form.

I hope that wasn't terribly complicating.
Maxus
Code:
<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
   'Reply-To: webmaster@example.com' . "\r\n";

mail($to, $subject, $message, $headers);
?>
cr3ativ3
Hey, Thanks muchly.
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.