Look at the RFC on SMTP - it tells you all the commands you need to know
to communicate with an SMTP server.
You will also need to do a DNS lookup and check the MX record for the
specified mail domain - the MX record will give you the preffered
mailhost for the specified domain and that is where your script should
send its mail to.
You can use simple sockets, or Net::Telnet or Net::SMTP.
Of course you should also add lots of security checks too!
Why not just setup a little linux box running sendmail configured as a
smarthost?
--
Simon
Bennett Haselton wrote:
> From what I understand, a "smarthost" is a mail transfer agent that takes
> an email address like "[EMAIL PROTECTED]", and looks at the
> "microsoft.com" part, contacts the mail servers directly that are
> responsible for "microsoft.com", and hands the message off to those
> servers. (It's a little more complicated than that, with MX records and A
> records... I'm hoping I won't have to find out all the details.)
>
> By contrast, a "dumb transfer agent" is a mail client that hands of all
> mail delivery to an SMTP server like "smtp.my-isp.com". In order for the
> mail to reach its eventual destination, smtp.my-isp.com has to either be a
> smarthost, or pass the request along to a smarthost.
>
> So, my question: is there a perl module for turning a perl script into a
> "smarthost"? That is, I can call a function to send mail to
> [EMAIL PROTECTED], and the perl script will automatically connect to the
> microsoft.com mail servers and send the message directly to them?
>
> The reason is because that I want to send mail from a particular machine.
> Because some ISP's will not accept mail from that machine, the machine uses
> another machine on the same network to do the actual mail-sending, and mail
> from that machine *does* get accepted. However, suppose I want to find out
> which subscribers to my newsletter are using ISP's which have configured
> their mail servers to block mail from the first machine. To do that, I
> would need to write a perl script to make that machine into a "smarthost",
> so that for each subscriber address of the form [EMAIL PROTECTED], the perl
> script can connect from the host machine directly to the mail servers for
> isp.com, and make a note if they are refusing mail from that IP address.
>
> -Bennett
>
> [EMAIL PROTECTED] http://www.peacefire.org
> (425) 649 9024
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users