I agree with you completely on Net::SMTP,
merlyn. However,
gaggio posted a module that has some additional functionality that Net::SMTP doesn't directly support.
All this depends on where you're counting on the SMTP server being located, however. If you're using the local machines, which is the wisest, then this argument holds no water. You can always count on being able to connect to the local SMTP server (as a general rule. Always check return results to be sure!). Additionally, a user may be getting his mail via POP3 or IMAP, because s/he may not have a local SMTP server that you can connect to.
If you're trying to connect to a SMTP mailserver on a remote network, then unless you know the actual address of the SMTP server, you may not be able to connect to it. The remote network may have an MX record for their SMTP server, since the mail machine may be mail.mynetwork.com, but has a different IP address than user@mynetwork.com.
To this end,
gaggios module uses DNS::Resolver to determine if an MX record exists for that network, and sends mail to the appropriate MX machine.
I think this idea is really good, although (and no offense,
gaggio) I'd really like to see it wrapped around Net::SMTP, instead of code that has had less exposuse to real world server issues.
--Chris
e-mail jcwren
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.