Thursday, December 11, 2008

Send a mail by tunning headers

You can do it thanks to the unix command : sendmail.

sendmail allows you to specify header fields before sending a mail thanks to "-t" option.

So you can explicitly configure mail's attributes like: From, Subject, Bcc, or even Importance, etc... (You can find
here an exhaustive list of these fields).

Here is a template called "mail.txt" containing both header and message to send :

From: XXX <xxx@mail.com>
To: YYY <yyy@mail.com>
CC: ZZZ <zzz@mail.com>
Bcc: HHH <hhh@mail.com>
Subject: Your subject
Importance: High
Content-Type: text/html
MIME-Version: 1.0
Return-Path: XXX <xxx@mail.com>
Your message.
Your message..


Then simply send the mail with command:
sendmail -t < mail.txt

Don't worry about Bcc field, it will not appear in the received mail (sendmail removes it).

3 comments:

Unknown said...

looking forward to see more tricks and also add the blogger gadget called follower .

Unknown said...

All done ;-)

sethe said...

xk996 fake bags mz650