Jump to content

Formmail.pl


jayson

Recommended Posts

Ok, after 3 hours I finally got it to work, but what I want to know, is when I use a script, and send it, I get it in my email with a from line like this:

 

"nobody@server112.tchmachines.com"

 

have can I get it to say:

 

me@jaysarahandy.com

 

Thanks

Link to comment
Share on other sites

The script needs to send mail sort of like this for that to happen.

 

>$mailprog = '/usr/sbin/sendmail -t';
$recip = "you\@yourTCHdomain";

open (MAIL, "|$mailprog -f$recip");
print MAIL "Reply-to: you\@yourTCHdomain\n";
print MAIL "From: you\@yourTCHdomain\n";
print MAIL "To: $E_Mail\n";
print MAIL "Subject: Your message has been received\n";
print MAIL "\n\n";
print MAIL "Thank you ".$First_Name." for using our on-line message form.\n";
print MAIL "\n";
print MAIL "We will respond to your query as quickly as possible.\n";
print MAIL "\n";
print MAIL "You submitted the following:\n";
print MAIL "\n";
print MAIL "Name:		  ".$First_Name." ".$Last_Name."\n";
print MAIL "E-mail:		".$E_mail."\n";
print MAIL "------------------------------------\n";
print MAIL "Comments:	  ".$Comments."\n";
print MAIL "------------------------------------\n";
print MAIL "\n";
print MAIL "If you require a response you should receive one within 48 hours, if not please submit \n";
print MAIL "this information again by replying to this message.\n";
print MAIL "\n";
print MAIL "Thank you,\n";
print MAIL "\n";
print MAIL "\n\n";
close (MAIL);

Link to comment
Share on other sites

thanks for the reply, but I am confused as to what I do with it, where do I put a file like that, sorry if I am sounding like a noob, but I look thought the web and it is so overwhelming that I have a hard time decivering it all.

 

Thanks

Link to comment
Share on other sites

Well it could but I don't know if it will. This is part of a script that I use on my company's website. The full script does a lot more than send a message to the person that filled out the form which is what this snippet does. I only posted this part to show how to create the headers so the server does not send mail as serverXX.tchmachines.com

 

The -f$recip on the $mailprog line authenticates $recip as the sender of the message. The Reply-To and From lines set up the message for the email client.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...