2

Any help would be greatly appreciated.

I'm trying to use sendmail to send a message with a custom "from" e-mail address. The body of the message is a file, pasted below.

What I'm seeing is that when I specify a "From:" address, the e-mail doesn't get sent at all. When I specify a "Reply-To" the reply-to address is ignored, and when I send using both a "From" and a "Reply-To", the message doesn't get sent.

The SMTP file used in the e-mail is pasted below. Again, thanks in advance for any advice you can offer.

SUBJECT: Testreplytofrom
From: <accounting@company.com>
Reply-To: <accounting@company.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="FILEBOUNDARY"

--FILEBOUNDARY
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

TEST MESSAGE
--FILEBOUNDARY
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
Dan P
  • 31
  • 1
  • 2

2 Answers2

2

1/ Remove "From" and "Reply-To" lines from your template email

2/ cat template.email | sendmail -f "accounting@company.com"

Chaoxiang N
  • 1,283
  • 5
  • 11
-1

You can try to use smtp-cli to send your email:

$ smtp-cli --verbose --server localhost --subject ... \
           --from accounting@company.com --to ...@... \
           --body-plain /path/to/the/file.txt

Refer to the smtp-cli page for more usage examples.

MLu
  • 24,849
  • 5
  • 59
  • 86