Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Mail::Sender code change

by Anonymous Monk
on May 09, 2019 at 14:05 UTC ( [id://1233508]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Mail::Sender is deprecated and I have to migrate some old code to a new server. Can someone suggest an alternative that supports high priority emails? In the old code all that was required was a priority => 2, option adding to the Open function. I've googled around and can send some emails using other modules but can't set priority. To be honest emailing from Perl seems far more messy these days than it was 10 years ago. I've been using Email::Stuffer can get work out how to set email priority with it and I don't really like method chaining code.

Replies are listed 'Best First'.
Re: Mail::Sender code change
by thanos1983 (Parson) on May 09, 2019 at 14:21 UTC
Re: Mail::Sender code change
by tangent (Parson) on May 09, 2019 at 14:49 UTC
    Priority in Mail::Sender is just a header field 'X-Priority' with values from 1 to 5. So all you need is to set a header field:
    # Email::Stuffer $email->header( 'X-Priority' => 1 ); # Email::Simple $email->header_set( 'X-Priority' => 1 );
Re: Mail::Sender code change
by Jenda (Abbot) on Aug 27, 2019 at 11:01 UTC

    Well ... it may be deprecated, but if it works, why change the scripts? While it's unlikely to get much love from the current maintainer anymore and thus the likelihood of adding support for new SMTP extensions is small, the "deprecated" doesn't mean it's gonna disappear.

    Jenda
    1984 was supposed to be a warning,
    not a manual!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1233508]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found