Just a follow up...
Using the example (below)in the Active State docs suggested by Odud,
I get a "Bad command of file name" error from DOS. The email, however,
is sent normally.
Stepping through the code in the debugger, I see that the error is
trigged by line 5, which initializes the smtp connection. I realize this may
be as much a Win98 question as a Perl one, but I'm hoping someone can explain
it to me. Thanks again for all your help.
use Net::SMTP;
$smtp = Net::SMTP->new('xp.psych.nyu.edu'); # connect to an SMTP server
$smtp->mail( 'zoubok@psych.nyu.edu' ); # use the sender's address here
$smtp->to('szoubok@flexdesigns.com'); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
#
$smtp->datasend("To: szoubok\@flexdesigns.com\n");
$smtp->datasend("From: zoubok\@psych.nyu.edu\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Hello, World!\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.