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

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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000066]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2017-06-24 12:25 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (557 votes). Check out past polls.