Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: Adding Attachment to Mail

Quote Reply
Re: Adding Attachment to Mail In reply to
Hi Alex,

"No message head was specified" is what I'm getting by the error log - but I'm not sure how to fix that? Do I have to use GT::Mail::Parts and specify a header part? Below is the error, and after that I've posted what I've got in my script at that section. (It's on a local network so I can't give you a URL to it.)

At this stage I'm just testing it with text/plain and sending a text file, but I want to send a jpeg in the end.

GT::Mail (14165): No message head was specified at /path/to/myscript.cgi line 95.

[Tue Aug 28 09:27:09 2001] [error] [client 192.168.1.224] Premature end of script headers: /path/to/myscript.cgi

---------------

# Parsing and sending

my $mail = new GT::Mail (debug => 1);

# Add an attachment to it

$mail->attach (
type => 'text/plain',
encoding => '-guess',
body_path => '/path/to',
filename => 'test.txt'
);

$mail->send(
to => $CFG->{db_admin_email},
from => $CFG->{db_admin_email} || '',
subject => "An Email 4 U!",
msg => "Hello World" || '',
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
debug => $Links::DEBUG
) or die "Error mailing Message.\n\n";


Cheers,
R.

Subject Author Views Date
Thread Adding Attachment to Mail ryel01 2056 Aug 27, 2001, 2:04 AM
Thread Re: Adding Attachment to Mail
Alex 1963 Aug 27, 2001, 1:11 PM
Thread Re: Adding Attachment to Mail
ryel01 1975 Aug 27, 2001, 1:33 PM
Thread Re: Adding Attachment to Mail
Alex 1976 Aug 27, 2001, 1:37 PM
Thread Re: Adding Attachment to Mail
ryel01 2047 Aug 27, 2001, 2:30 PM
Thread Re: Adding Attachment to Mail
bline 1970 Aug 27, 2001, 2:48 PM
Post Re: Adding Attachment to Mail
ryel01 1964 Aug 27, 2001, 3:20 PM