PDA

View Full Version : email script


lemmiwinksx
04-19-2003, 08:22 AM
hey, i wrote a very simple form to email script (im new to programing :o )
and when it gets sent, sender is'nt the one i want it to be. instead its somethingbox@netfirms.com (its hosted by netfirms) and i want it to be from cowsin@aol.com
heres the script, i hope someone can help me? please? thanx

#!usr/bin/perl

use CGI;

my $q = new CGI;

$msg = $q->param("msg");

$reply = "cowsin\@aol.com";

$recipient = "lemmiwinksx\@lemmiwinksx.com";

$mailprog = '/usr/lib/sendmail';

print "Content-type: text/html\n\n";

open (MAIL, "|$mailprog -t") or dienice("Can't access $mailprog!\n");

print MAIL "To: $recipient\n";

print MAIL "Reply-to: $reply\n";

print MAIL "Subject: Form Data\n\n";

print MAIL "$msg";

close(MAIL);

print "<html><body>";

print "THANKS :-]";

print "</body></html>";

chrisvmarle
04-19-2003, 12:33 PM
$reply = "cowsin\@aol.com";

$from = "whatYou\@want.com";

$recipient = "lemmiwinksx\@lemmiwinksx.com";

open (MAIL, "|$mailprog -t") or dienice("Can't access $mailprog!\n");

print MAIL "From: $from\n";

print MAIL "To: $recipient\n";

I hope that's enough information for you

lemmiwinksx
04-19-2003, 06:42 PM
it still wont work, maybe you can see what i missed:

#!usr/bin/perl

use CGI;

my $q = new CGI;

$msg = $q->param("msg");

$form = "cowsin\@aol.com";

$recipient = "lemmiwinksx\@lemmiwinksx.com";

$mailprog = '/usr/lib/sendmail';

open (MAIL, "|$mailprog -t") or dienice("Can't access $mailprog!\n");

print MAIL "From: $from\n";

print MAIL "To: $recipient\n";

print MAIL "Subject: Form Data\n\n";

print MAIL "$msg";

close(MAIL);

print "Content-type: text/html\n\n";

print "<html><body>";

print "THANKS :-]";

print "</body></html>";




thanx

:)