Jump to content


Form to mail code

  • Please log in to reply
3 replies to this topic

#1 martin20009

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 March 2006 - 10:17 PM

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


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

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


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,


$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

#2 hitman6003

  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 March 2006 - 10:32 PM

mail($to, $subject, $msg, $headers, "-f someuser@somedomain.com");

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

#3 martin20009

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 13 March 2006 - 10:08 AM

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

#4 wildteen88

  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 13 March 2006 - 10:51 AM

Just replace this code:
mail($to, $subject, $msg, "From: My web site\nReply-To: $email\n");
mail($to, $subject, $msg, "From: My web site\nReply-To: $email\n", "-f someuser@somedomain.com");

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users