[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] Stupid beginner question



On Mon, 28. May 2007, 15:08:30 +0200, Anders Persson wrote:
> Spending som hour, i have som question
> 
> My problem today
> I like to send automatic mail, from a server, to a mailserver on a other 
> machine
> on this machine a have a mailserver.
> 
> I set upp a configfile, with user, password etc.
> 
> I make a testfiles
> Subject asdfasdfsa
> 
> Textdfasdfasdf
> 
> .
> 
> And try
> ./msmtp user@...109... < letter
> 
> But i don't get any sender and nu subject
> 
> Any ide ???

You should not write the mail message yourself. Use a mail user agent
for that, for example Mutt: configure Mutt to use msmtp to send mails,
and then use
mutt -s "My Subject" user@...113... < letter
or something similar.
Mutt will build correct headers for the mail.

In your example, you did not get a Subject and a From header because you
did not properly specify them in your testfile. The following should
work:
---
Subject: My Subject
From: me@...114...

Text goes here.
---

Note that the envelope-from address (the one given in your .msmtprc) and
the recipient address (given on the command line) may be different from
what is given in your self-written mail in some cases. Therefore, you
have to set proper From: and To: headers yourself.

It is better to use Mutt to get the mail headers, encodings,
attachments etc. right.

Regards,
Martin