Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Duplicate emails using MIME::Lite with smtp

by sandor.farkas (Initiate)
on Apr 16, 2014 at 09:36 UTC ( #1082471=perlquestion: print w/ replies, xml ) Need Help??
sandor.farkas has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I have an issue sending emails via MIME::Lite module. I have to set some header parameters (return-path and reply-to) therefore I have to use $msg->send('smtp', $SMTP_HOST);

If I understand right in this case the message now sent via Net::SMTP. Unfortunately it results that if an email address is included in both to and cc fields the message is delivered twice. I'm googling for a while now, but I can't figure out what is the reason behind. Can anyone please give me a hint on this?

Thank you in advance!
Sandor

Comment on Duplicate emails using MIME::Lite with smtp
Download Code
Re: Duplicate emails using MIME::Lite with smtp
by hippo (Curate) on Apr 16, 2014 at 10:37 UTC

    The behaviour described is precisely what should happen. If you do not want a user to receive two copies, don't send them two copies in the first place. You could use something like List::MoreUtils to deduplicate your recipient lists in advance.

      Thank you, I will filter the recipients then.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2014-11-24 16:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (143 votes), past polls