Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

change email header ?

Quote Reply
change email header ?
hi i change this code and add the content line but nothing happens. Can someone help me ?


# Get a filehandle, and open pipe to sendmail.
my $s = &FileHandle::new('FileHandle');
open ($s, "|$self->{'sendmail'}");
print $s "To: ", $self->{'to'}, "\n";
print $s "From: ", $self->{'from'}, "\n";
print $s "Reply-to: ", $self->{'reply'}, "\n" if $self->{'reply'};
print $s $self->{'headers'}, "\n" if $self->{'headers'};
print $s "X-Mailer: Mailer::$VERSION (http://www.gossamer-threads.com/scripts/)\n";
print $s "Subject: ", $self->{'subject'}, "\n\n";
print $s "Content-type: text/html\n";
print $s $self->{'msg'};
close $s;

Quote Reply
Re: change email header ? In reply to
See previous post. You added the code after the separating new line.

Try adding it before the subject header.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: change email header ? In reply to
If you look, the Mailer.pm looks for a 'header' tag, that is inserted just before the subject line:

print $s $self->{'headers'}, $CRLF if $self->{'headers'};


If you look at the 'subject' line, you'll see it's terminated by '\n\n' rather than a sigle '\n'

Remember, a single blank line is the terminator of the 'header' of a mail message and the body of the mail message. Hence ... \n\n . it terminates the preceeding line, then inserts a blank line.

Easy to miss, but that's what's happening.


http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/