Gossamer Forum
Home : General : Perl Programming :

Re: [delicia] Sending file by email blues :(

Quote Reply
Re: [delicia] Sending file by email blues :( In reply to
Hi,

To send with SMTP you want to use Email::Sender::Transport::SMTP:

Code:
my $transport = Email::Sender::Transport::SMTP->new({
host => 'smtp.gmail.com',
port => 465,
ssl => 1,
sasl_username => 'smtpusername',
sasl_password => 'smtp pass'
});

Then the sendmail() call looks like:

Code:
sendmail($email->as_string, { transport => $transport } );

If you want to send BCC, you have to do it like:

Code:
sendmail($email->as_string, { transport => $transport, to => [$to, $bcc] } );

I tried it before with just headers, but they were ignored and no CC/BCC's were sent out

I'm still playing with the attachment stuff. Basically, the issue is the structure of the email. It has to send like:

Code:
multipart/mixed
|- multipart/alternative << mail client will choose which of the parts to display
| | text/plain << the mail as plain text
| | text/html << the mail as HTML
|- text/plain << the attachment

But is instead sending all the parts with 1 boundary ID:

Code:
multipart/mixed
|- multipart/alternative << mail client will choose which of the parts to display
| | text/plain << the mail as plain text
| | text/html << the mail as HTML
|- text/plain << the attachment

Its weird - because when I was writing this email code before, it all worked fine in the tests! So looks like its not been behaving properly in some email clients for a while :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Sending file by email blues :( Andy 13304 Aug 27, 2001, 4:22 AM
Thread Re: Sending file by email blues :(
Paul 13111 Aug 27, 2001, 4:35 AM
Thread Re: Sending file by email blues :(
Andy 13135 Aug 27, 2001, 5:30 AM
Post Re: Sending file by email blues :(
Paul 13095 Aug 27, 2001, 5:35 AM
Thread Re: Sending file by email blues :(
Paul 13117 Aug 27, 2001, 5:36 AM
Post Re: Sending file by email blues :(
Andy 13106 Aug 27, 2001, 5:40 AM
Thread Re: Sending file by email blues :(
Alex 13093 Aug 27, 2001, 9:54 AM
Post Re: Sending file by email blues :(
Andy 13078 Aug 27, 2001, 12:35 PM
Thread Re: [Andy] Sending file by email blues :(
delicia 11204 Feb 3, 2020, 8:01 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 11200 Feb 3, 2020, 10:21 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 11198 Feb 3, 2020, 11:44 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 11186 Feb 4, 2020, 12:09 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 11180 Feb 4, 2020, 6:51 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 11183 Feb 4, 2020, 6:53 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 10708 Mar 15, 2020, 7:36 AM
Post Re: [delicia] Sending file by email blues :(
Andy 10701 Mar 16, 2020, 12:16 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 10701 Mar 16, 2020, 12:18 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 10689 Mar 16, 2020, 1:32 PM
Thread Re: [delicia] Sending file by email blues :(
Andy 10683 Mar 17, 2020, 12:14 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 10620 Mar 18, 2020, 4:54 PM
Thread Re: [delicia] Sending file by email blues :(
Andy 10613 Mar 18, 2020, 11:49 PM
Thread Re: [Andy] Sending file by email blues :(
delicia 10610 Mar 19, 2020, 2:40 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 10603 Mar 19, 2020, 4:03 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 10600 Mar 19, 2020, 5:29 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 10593 Mar 19, 2020, 5:32 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7279 Mar 19, 2020, 5:38 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7277 Mar 19, 2020, 5:46 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7277 Mar 19, 2020, 5:53 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7276 Mar 19, 2020, 5:57 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7278 Mar 19, 2020, 6:04 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7273 Mar 19, 2020, 6:08 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7271 Mar 19, 2020, 6:20 AM
Thread Re: [delicia] Sending file by email blues :(
delicia 7266 Mar 19, 2020, 8:24 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7268 Mar 19, 2020, 8:45 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7264 Mar 19, 2020, 10:21 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7256 Mar 20, 2020, 12:06 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7246 Mar 20, 2020, 3:23 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7247 Mar 20, 2020, 3:38 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7251 Mar 20, 2020, 3:43 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7244 Mar 20, 2020, 3:45 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7242 Mar 20, 2020, 3:50 AM
Thread Re: [delicia] Sending file by email blues :(
Andy 7242 Mar 20, 2020, 4:10 AM
Thread Re: [Andy] Sending file by email blues :(
delicia 7248 Mar 20, 2020, 4:29 AM
Post Re: [delicia] Sending file by email blues :(
Andy 7239 Mar 20, 2020, 4:34 AM
Post Re: [delicia] Sending file by email blues :(
Andy 7248 Mar 20, 2020, 2:01 AM