Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing from a Windows Server with Localhost

Status
Not open for further replies.

compuv

MIS
Mar 16, 2002
10
GB
I'm using a really neat send-a-card program which works beautifully on our hosted account on a Windows server. Or at least it works right up until I try and email the card! My host provider tells me all I need to do is specify "localhost" but I must admit I'm puzzled. Specify it where?!

Here's the relevant mailing part of the script:

sub send {
$SENDMAIL="$mailprog";

open (MAIL, "| $SENDMAIL $FORM{'mail'}");

print MAIL "Reply-to: $FORM{'replyto'}\n";
print MAIL "From: $FORM{'replyto'}\n";
print MAIL "To: $FORM{'mail'}\n";
print MAIL "Subject: You have a scotsinfo-card!\n\n";
print MAIL "========================================================\n";
print MAIL "You have a scotsinfo card from $FORM{'from'}. ($FORM{'replyto'})\n\n";
print MAIL "To see your card\n";
print MAIL "point your web browser to\n\n";
print MAIL "$postcardurl\n\n";
print MAIL "The password you will need to use to get it is $word\n\n";
print MAIL "Your card will be removed in two weeks if\n";
print MAIL "you have not retrieved it by then.\n\n";
print MAIL "Sincerely, \n\n";
print MAIL "$title\n";
print MAIL "$postcardurl\n";
close MAIL;
}

I know that this is for a UNIX system and that $mailprog points to the location of SENDMAIL in the .cfg file, but how do I modify the above to use localhost on Windows?

Any help would be greatly appreciated. Many thanks.

Dave
 
Look under PERL FAQ for sending mail for non-Unix machines. It has the appropriate script, submitted by Mike Lacey (I haven't gotten it to work, myself, yet, though).

Your localhost is the name of your server, and the Windows script in the FAQ calls it out. Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top