Open Source Development Tutorials | About Us
Search  

Go Back   Open Source Tutorials Forum > Programming Languages > Perl Programming
User Name
Password
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-23-2006, 01:23 AM
pawan.sangal pawan.sangal is offline
Junior Member
 
Join Date: Jun 2006
Posts: 3 pawan.sangal is on a distinguished road
Default How to send attachments through an SMTP server

Hello Friends,

I want to send attachments through a SMTP server.
Iam already sending mails through it (using Net::SMTP utility). But, till now Iam only able to send only messages and not with attachments.

Can anybody tell me how to send attachments while sending mails on other's mail id.

As, Iam novice to Perl, It will be greatly helpful for me if anyone can provide me a code for sending the attachment. So, I could be able to send both message and attachment together.

It will be better, if someone can guide me for that or using Net::SMTP utility.

Thanks in advance......
Pawan Sangal
Reply With Quote
  #2  
Old 10-15-2008, 04:05 AM
FredrickGeofry FredrickGeofry is offline
Junior Member
 
Join Date: Aug 2008
Posts: 3 FredrickGeofry is on a distinguished road
Post

Through a guide i have found a tutorial in which this synopsis was given that

use Mail::Sender;
$sender = new Mail::Sender
{smtp => 'mail.yourdomain.com', from => 'your@address.com'};
$sender->MailFile({to => 'some@address.com',
subject => 'Here is the file',
msg => "I'm sending you the list you wanted.",
file => 'filename.txt'});
Reply With Quote
  #3  
Old 10-21-2008, 05:51 AM
SamBogs SamBogs is offline
Junior Member
 
Join Date: Oct 2008
Posts: 3 SamBogs is on a distinguished road
Default

For attachments, you need to create a multipart MIME message.
You can use the Net::SMTP::Multipart module in perl to do the job for you.
Here is the documentation on Net::SMTP::Multipart:

http://search.cpan.org/~DROBERTS/Net...t/Multipart.pm
__________________
Quality Inspection Credit Union PA
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 12:10 AM.


Powered by: vBulletin Version 3.0.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2004 - 2006 GrindingGears.com. All Rights Reserved.