Appy16 has asked for the wisdom of the Perl Monks concerning the following question:
Hi..
I'm trying to send an email using the Script I've posted below. The script downloads a particular file and mails it as an attachment but has just one problem.
The problem is that the email i am sending is sent into Spam or the Junk folder.
How can i authenticate the mail using this script.
#!/usr/bin/perl use LWP::Simple; use MIME::Lite; use Spreadsheet::WriteExcel; $from = 'abc\@gmail.com'; $to = 'def\@gmail.com'; $Subject = 'Daily Social Media search'; my $url = "abc.org/?xyz=csv"; my $file = "/Users/abc/Desktop/abc.csv"; my $status = mirror($url,$file); die "Cannot retrieve $url" unless is_success($status); # Part using which the file being downloaded is sent as an attachment +to an email # $msg = MIME::Lite->new( From => $from, To => $to, Subject => $Subject, Type => 'multipart/Mixed', ); $msg->attach( Type => 'Text', Data => "The attachment contains the csv file downloaded t +oday." ); $msg->attach( Type => 'Application/Text', Path => "/Users/abc/Desktop/abc.csv" ); print "Mail Sent\n"; $msg->send; # send via default
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Authenticating the Mail Sent
by scorpio17 (Canon) on Mar 10, 2010 at 16:51 UTC | |
by Anonymous Monk on Mar 10, 2010 at 16:56 UTC | |
by Appy16 (Sexton) on Mar 11, 2010 at 04:58 UTC | |
Re: Authenticating the Mail Sent
by Anonymous Monk on Mar 10, 2010 at 07:34 UTC | |
by Appy16 (Sexton) on Mar 10, 2010 at 07:42 UTC | |
by almut (Canon) on Mar 10, 2010 at 07:51 UTC | |
by Appy16 (Sexton) on Mar 10, 2010 at 08:16 UTC | |
by Anonymous Monk on Mar 10, 2010 at 08:19 UTC | |
|
Back to
Seekers of Perl Wisdom