Gossamer Forum
Quote Reply
GT::Mail Attachments...
Hi,

I'm having some problems with attaching a PDF to an email, via GT::Mail Unsure

The code in question is;

Code:
# Create and Sending
my $mail = GT::Mail->new(debug => 1);
my $parser = $mail->parse('file_attached.txt') or die "Error: $GT::Mail::error";

$mail->attach (
type => 'application/pdf',
encoding => '-guess',
body_path => "D:\\tempPDF\\$id.pdf",
filename => "$id.pdf"
);

my $msg = Dumper($link);
$msg .= Dumper($user);

$parser->set("to", $to);
$parser->set("from", $from);
$parser->set("subject", $subject);
$parser->set("msg", $msg);
$parser->set("type", 'text/html');

# Send the email we just parsed and modified
$mail->send(smtp => 'localhost') or die "Error: $GT::Mail::error";

Anyone got any ideas? It just comes up witjh stuff like this now;

Quote:
ype: text/html
Date: Wed, 04 May 2005 16:59:16 +0100
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: multipart/mixed; boundary="---------=_1115222356-3216-130383814"

This is a multi-part message in MIME format.

-----------=_1115222356-3216-130383814
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

-----------=_1115222356-3216-130383814
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="152354.pdf"

JVBERi0xLjMKJeLjz9MKMSAwIG9iago8PC9UeXBlL1BhZ2VzL0NvdW50IDQvS2lkc1s0IDAgUiA5
IDAgUiAxMyAwIFIgMTcgMCBSXT4+CmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvQ2F0YWxvZy9QYWdl
cyAxIDAgUj4+CmVuZG9iagozIDAgb2JqCjw8L1RpdGxlIChNaWNyb3NvZnQgV29yZCAtIDE1MjM1
NC5kb2MpL0NyZWF0b3IgKFdpbjJQREYgMi44MCBodHRwOi8vd3d3LmRhbmVwcmFpcmllLmNvbSkv
QXV0aG9yIChBZG1pbmlzdHJhdG9yKS9DcmVhdGlvbkRhdGUgKEQ6MjAwNTA1MDQxNjU5MTMpL1By

Any ideas? :/

TIA

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!

Last edited by:

Andy: May 4, 2005, 9:00 AM
Quote Reply
Re: [Andy] GT::Mail Attachments... In reply to
Anyone? :/

TIA

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!