I have been tasked to send customized emails to a set of users based on a certain condition in my company. ( This is NOT SPAM )
I have used MIME::Lite successfully to send html templates as emails. the users in my company are Outlook users. But for some reason my emails sometimes reach the Junk E-Mail folder( I am sending using my own company issued email address )
Here's the code I currently use:
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl -w
- use strict;
- use diagnostics;
- use MIME::Lite;
- sub send_email()
- {
- open my $fh ,"data/address.txt" or die "Cannot open file:$!\n";
- my @filename =&fileread('htmlcode.htm');
- while(<$fh>)
- {
- chomp;
- my $msg = MIME::Lite->new( From =>"user\@host\.com",
- To =>$_,
- Subject =>"Action Required! Complete your Registration",
- Disposition =>'inline',
- Type =>'multipart/related');
- $msg->attach(Type => 'text/html', Data => qq{@filename});
- $msg->attach(Type => 'image/gif',Id => 'img1.jpg',
- Path => "images/img1.jpg");
- $msg->attach(Type => 'image/gif',Id => 'img2.gif',
- Path => "images/img2.gif");
- $msg->attach(Type => 'image/gif',Id => img3.gif',
- Path => "images/img3.gif");
- $msg->send("sendmail","/usr/sbin/sendmail -t");
- }
- close $fh;
- }
- &send_email();
Is there anyway to avoid the routing to the Junk mail folder in microsoft outlook ?
Thanks,
Santhosh