http://www.perlmonks.org?node_id=120727


in reply to primitve SMTP

I didn't to have to make him install the smtp server module.

What you really need is an SMTP client module, such as Net::SMTP, whose author has gone through great pains to implement all the intricacies of the various RFCs covering this protocol.

Once you've changed some of the headers as pointed out by earlier responses, your code will fail in all sorts of mysterious ways, for example it fails to correctly interpret server reponses and will loop endlessly when the server emits a 4xx or 5xx error code. This will happen when you least expect it: an unforeseen change in the server's configuration, a transient DNS error, an attempt to send a message whose size is larger than what the server accepts, etc.