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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not working! Help! email from perl script 1

Status
Not open for further replies.

marybailey

Programmer
Mar 14, 2002
47
US
Does anyone know why this is not working? It takes it but I never receive the email. Thanks!

sub send_mail {

$friend="mrsgbailey\@yahoo.com";
# Open The Mail Program
open(MAIL,"|$mailprog -t");

print MAIL "To: $friend\n";
print MAIL "From: $friend\n";
print MAIL "Subject: blah blah\n";
print MAIL "Content-Type: text/html; charset=us-ascii\n\n";
print MAIL &quot;<html>\n&quot;;
print MAIL &quot;<head>\n&quot;;
print MAIL &quot;</head>\n&quot;;
print MAIL &quot;<body>\n&quot;;
print MAIL &quot;<BR>---------------------------------------------------<BR>\n&quot;;
print MAIL &quot;</body>\n&quot;;
print MAIL &quot;</html>\n&quot;;
close (MAIL);

 
[Under the assumption that perl hasn't report any errors...]

What troubleshooting steps have you gone through? Some of the questions about your problem that spring to my mind are:


If you create a text-file by hand that duplicates the output of that subroutine and cat that file to your mail program, do you get it then?

Does the subroutine correctly read the value of $mailprog?

Does the subroutine work if you send to a different recipient, or send ASCII-text rather than HTML?
 
I dont know how but I fixed it.
I didnt really know how to trouble shoot it beyond checking the values on the vars were correct. It didnt give me any errors just ran and didnt deliver.
How do I cant a file to my mail program?
 
Sorry, I was unclear. &quot;cat&quot; is the command. If you are on a Microsoft platform, the equivalent command is &quot;type&quot;. One would pipe the output of that command into your mail program. It's the hand-crafted version of what your subroutine does.

The question that intrigues me is, if your subroutine correctly inserted the mail into the mail server, and you did not receive it, where did the email go?
 
What's the value of your variable $mailprog ? Mike
________________________________________________________________

&quot;Experience is the comb that Nature gives us, after we are bald.&quot;

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top