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.
"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.