Jump to content

Archived

This topic is now archived and is closed to further replies.

martin20009

Form to mail code

Recommended Posts

I downloaded the tutorial Creating a mail form wth php and flash.
I am having problems with the code.

<?php

$to = "you@yourdomain.com";
$msg = "$name\n\n";
$msg .= "$message\n\n";

mail($to, $subject, $msg, "From: My web site\nReply-To: $email\n");

?>
[/code]

But the problem is that my website host says In order for the script to work, you need to specify, via a fifth -f parameter, the domain from which the mail is being sent. The PHP component uses SMTP (Simple Mail Transfer Protocol), and all StreamlineNet' SMTP servers have filters which ensure that the data returned by either the first or fifth mail parameter relates to one of your domains hosted by StreamlineNet and gives me the following code,

<?php

$message, "From: $email", "fuser@userdomain.com" );
?>

Where do i place this line of code in the the sorce code

I am new to this and any help would be great
Thanks
Martin

Share this post


Link to post
Share on other sites
[code]mail($to, $subject, $msg, $headers, "-f someuser@somedomain.com");[/code]

Essentially, it forces the header to look like it's coming from that person.

Share this post


Link to post
Share on other sites
I know it may be a stuip question, do I delete any lines of the original code, and where do I inset this peice of code you have posted.

Thanks for your help

Share this post


Link to post
Share on other sites
Just replace this code:
[code]mail($to, $subject, $msg, "From: My web site\nReply-To: $email\n");[/code]
with:
[code]mail($to, $subject, $msg, "From: My web site\nReply-To: $email\n", "-f someuser@somedomain.com");
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.