Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to print the recipients address in my mail

by tobyink (Abbot)
on Oct 19, 2012 at 23:03 UTC ( #1000066=note: print w/ replies, xml ) Need Help??


in reply to How to print the recipients address in my mail

You would probably be better off using something like Mail::Box because Net::SMTP is very low-level.

But in answer to your question, mails sent by SMTP have two places where the recipient is specified: the so called "envelope header" which is part of the SMTP protocol itself (yes, I'm aware what the P stands for), and the "message header" which is part of the RFC 822 format (and successors).

It is the message header which email clients display. They don't usually have access to the envelope header at all, unless the mail server makes part of it available to them (which is quite common; usually by reformatting parts of it and adding them to the message header). Net::SMTP is an SMTP implementation which doesn't concern itself with the formatting of the message itself at all.

Anyway, to cut a long story short...

$smtp->datasend("To: $to\nSubject: TEST MAIL\n\n@csv");
1000066 and all that


Comment on Re: How to print the recipients address in my mail
Download Code
Re^2: How to print the recipients address in my mail
by chandru210486 (Initiate) on Oct 22, 2012 at 22:26 UTC

    Thanks - It is working now.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000066]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-12-25 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (161 votes), past polls