Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Blank Subject & From header when sending email with ssmtp

    I am trying to send an email with ssmtp from my PC and am a bit stumped. I can send it fine from the command line and with a script, but the resulting email varies base how it is sent.

    From a command line I type the following:
    Subject: Test email

    This is the message body

    This method works fine. The From name & Subject show up in the recipients email. Basically, it looks like a regular email in the recipients email client just as if I sent it from Outlook.
    The "body" of the email only contains "This is the message body" as it should.

    If I pass a file with the email information to ssmtp on the command line, the email is sent and received, but it comes through with a blank “Subject” and “From” in the header. The only data in the email header is the “To”. The missing Subject & From comes through in the message body of the email. So, when the recipient looks at his/her email client, it looks like it came from no one.

    For testing purposes I type the following from a command line:

    /usr/sbin/ssmtp <email.txt

    Here is the contents of email.txt

    SUBJECT: Test email

    This is the message body

    When the recipient views with email this is what the "body" looks like:

    Subject: Test email
    X-Brightmail-Tracker: AAAAARyBy98=
    X-Brightmail-Tracker: AAAAAA==

    This is the message body

    Any idea what is happening here?

  2. #2
    I figured it out. I created the email.txt file in Windows and copied it to my Linux box. That caused the problem. Once I created the file on Linux, everything was fine. I'm new to Linux and thought that since I can view files that are created in Linux on my Windows system, I should be able to create files in Windows and drop them on the Linux box without issue. I thought wrong.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts