Sendmail Attachment2019 Community Moderator ElectionTrying to send HTML mail on mac OSX Mountain LionScript to email all matching files in a directoryUnix “Mail, Mailx and sendmail” command sending blank attachment on IOSHow to set mail subject using variable and ensure attachment is not included in email bodysendmail attachment is emptyunderstand sendmail log messagesHow can I add an attachment with Sendmail (limited options)?Sending mail with sendmail and attachmentWhat is the standard interface used by linux system programs to send notification mail?Sending mail with attachment(image) using sendmail in Linux(ksh)
What is this high flying aircraft over Pennsylvania?
Can you take a "free object interaction" while incapacitated?
Derivative of an interpolated function
In the event of Brexit being postponed beyond the EU elections, will UK voters in EU countries be eligible to participate?
"Marked down as someone wanting to sell shares." What does that mean?
C++ lambda syntax
A seasonal riddle
Started in 1987 vs. Starting in 1987
What properties make a magic weapon befit a Rogue more than a DEX-based Fighter?
Why didn’t Eve recognize the little cockroach as a living organism?
Why is participating in the European Parliamentary elections used as a threat?
Why didn't Voldemort know what Grindelwald looked like?
Why do Radio Buttons not fill the entire outer circle?
Showing mass murder in a kid's book
Reason why a kingside attack is not justified
Asserting that Atheism and Theism are both faith based positions
Toggle window scroll bar
Hashing password to increase entropy
Has the laser at Magurele, Romania reached the tenth of the Sun power?
Exposing a company lying about themselves in a tightly knit industry (videogames) : Is my career at risk on the long run?
What should be the ideal length of sentences in a blog post for ease of reading?
Sort with assumptions
Can a Knock spell open the door to Mordenkainen's Magnificent Mansion?
Travelling in US for more than 90 days
Sendmail Attachment
2019 Community Moderator ElectionTrying to send HTML mail on mac OSX Mountain LionScript to email all matching files in a directoryUnix “Mail, Mailx and sendmail” command sending blank attachment on IOSHow to set mail subject using variable and ensure attachment is not included in email bodysendmail attachment is emptyunderstand sendmail log messagesHow can I add an attachment with Sendmail (limited options)?Sending mail with sendmail and attachmentWhat is the standard interface used by linux system programs to send notification mail?Sending mail with attachment(image) using sendmail in Linux(ksh)
I was wondering if it's possible to include an attachment with sendmail. I am generating the following emailfile.eml files with the following layout
From: Company Name <example@nowhere.com>
To: recipient@madeup.com
CC: someoneelse@place.com
Subject: Generated Output
Mime-Version: 1.0
This will be the body copy even though it's terrible
I am sending these emails using
# /usr/sbin/sendmail -t < emailfile.eml
This part is working file but I would like to include an attachment to this email and I have not figured out how to do it
centos email sendmail
|
show 4 more comments
I was wondering if it's possible to include an attachment with sendmail. I am generating the following emailfile.eml files with the following layout
From: Company Name <example@nowhere.com>
To: recipient@madeup.com
CC: someoneelse@place.com
Subject: Generated Output
Mime-Version: 1.0
This will be the body copy even though it's terrible
I am sending these emails using
# /usr/sbin/sendmail -t < emailfile.eml
This part is working file but I would like to include an attachment to this email and I have not figured out how to do it
centos email sendmail
Useuuencodeormutt.
– serenesat
Aug 17 '15 at 10:11
I was hoping to use something more like Content-Disposition: attachment but I can't get it to work
– Trent
Aug 17 '15 at 10:13
Do you want some text AND attachment OR attachment only? ["attachment only" case is trivial ]
– AnFi
Aug 17 '15 at 11:25
I'd like to send body copy and the attachment, preferably using sendmail and the eml file with Content-Disposition
– Trent
Aug 17 '15 at 11:31
In such case the most simple is to use email client e.g. mutt
– AnFi
Aug 17 '15 at 17:39
|
show 4 more comments
I was wondering if it's possible to include an attachment with sendmail. I am generating the following emailfile.eml files with the following layout
From: Company Name <example@nowhere.com>
To: recipient@madeup.com
CC: someoneelse@place.com
Subject: Generated Output
Mime-Version: 1.0
This will be the body copy even though it's terrible
I am sending these emails using
# /usr/sbin/sendmail -t < emailfile.eml
This part is working file but I would like to include an attachment to this email and I have not figured out how to do it
centos email sendmail
I was wondering if it's possible to include an attachment with sendmail. I am generating the following emailfile.eml files with the following layout
From: Company Name <example@nowhere.com>
To: recipient@madeup.com
CC: someoneelse@place.com
Subject: Generated Output
Mime-Version: 1.0
This will be the body copy even though it's terrible
I am sending these emails using
# /usr/sbin/sendmail -t < emailfile.eml
This part is working file but I would like to include an attachment to this email and I have not figured out how to do it
centos email sendmail
centos email sendmail
edited 12 hours ago
Trent
asked Aug 17 '15 at 9:27
TrentTrent
1,39181634
1,39181634
Useuuencodeormutt.
– serenesat
Aug 17 '15 at 10:11
I was hoping to use something more like Content-Disposition: attachment but I can't get it to work
– Trent
Aug 17 '15 at 10:13
Do you want some text AND attachment OR attachment only? ["attachment only" case is trivial ]
– AnFi
Aug 17 '15 at 11:25
I'd like to send body copy and the attachment, preferably using sendmail and the eml file with Content-Disposition
– Trent
Aug 17 '15 at 11:31
In such case the most simple is to use email client e.g. mutt
– AnFi
Aug 17 '15 at 17:39
|
show 4 more comments
Useuuencodeormutt.
– serenesat
Aug 17 '15 at 10:11
I was hoping to use something more like Content-Disposition: attachment but I can't get it to work
– Trent
Aug 17 '15 at 10:13
Do you want some text AND attachment OR attachment only? ["attachment only" case is trivial ]
– AnFi
Aug 17 '15 at 11:25
I'd like to send body copy and the attachment, preferably using sendmail and the eml file with Content-Disposition
– Trent
Aug 17 '15 at 11:31
In such case the most simple is to use email client e.g. mutt
– AnFi
Aug 17 '15 at 17:39
Use
uuencode or mutt.– serenesat
Aug 17 '15 at 10:11
Use
uuencode or mutt.– serenesat
Aug 17 '15 at 10:11
I was hoping to use something more like Content-Disposition: attachment but I can't get it to work
– Trent
Aug 17 '15 at 10:13
I was hoping to use something more like Content-Disposition: attachment but I can't get it to work
– Trent
Aug 17 '15 at 10:13
Do you want some text AND attachment OR attachment only? ["attachment only" case is trivial ]
– AnFi
Aug 17 '15 at 11:25
Do you want some text AND attachment OR attachment only? ["attachment only" case is trivial ]
– AnFi
Aug 17 '15 at 11:25
I'd like to send body copy and the attachment, preferably using sendmail and the eml file with Content-Disposition
– Trent
Aug 17 '15 at 11:31
I'd like to send body copy and the attachment, preferably using sendmail and the eml file with Content-Disposition
– Trent
Aug 17 '15 at 11:31
In such case the most simple is to use email client e.g. mutt
– AnFi
Aug 17 '15 at 17:39
In such case the most simple is to use email client e.g. mutt
– AnFi
Aug 17 '15 at 17:39
|
show 4 more comments
2 Answers
2
active
oldest
votes
With mutt you can simply use:
echo "This is the message body" | mutt -a "/path/to/file_to_attach" -s "subject of message" -- recipient@domain.com
Using mail command:
mail -a /opt/emailfile.eml -s "Email File" user@example.com < /dev/null
-a is used for attachments.
You can use SendEmail:
sendemail -t to@example.com -m "Here is the file." -a attachmentFile
SendEmailis for Ubuntu, so not sure if it will work for CentOS or not.
– serenesat
Aug 17 '15 at 10:36
Yeah, I don't havesendemailon my workplace's CentOS, we just havesendmail.
– Alexej Magura
Aug 29 '17 at 18:10
add a comment |
Posting the solution that worked for me in case it can help anyone else, sorry it's so late.
The most reliable way I found for doing this was to include the attachment as base64 in the eml file itself, bellow is an example of the eml contents.
Note 01 : the base64 for the file comes from running the base64 command on linux using the attachment as an argument (should work with any base64 tool)
Note 02 : the string used for the boundary is just nonsense using the date and random upper case letters
Filename : emlfile.eml
From: Sender <sender@email.co.za>
To: recipient01@email.co.za
CC: recipient02@email.co.za
Disposition-Notification-To: recipient01@email.co.za
Subject: Generic Subject
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="19032019ABCDE"
--19032019ABCDE
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Generic Body Copy
--19032019ABCDE
Content-Type: application;
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="MyPdfAttachment.pdf"
*base64 string goes here (no asterix)*
--19032019ABCDE--
Then the filename.eml file can be sent using the command and it will include the attachment
# /usr/sbin/sendmail -t < filename.eml
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f223636%2fsendmail-attachment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
With mutt you can simply use:
echo "This is the message body" | mutt -a "/path/to/file_to_attach" -s "subject of message" -- recipient@domain.com
Using mail command:
mail -a /opt/emailfile.eml -s "Email File" user@example.com < /dev/null
-a is used for attachments.
You can use SendEmail:
sendemail -t to@example.com -m "Here is the file." -a attachmentFile
SendEmailis for Ubuntu, so not sure if it will work for CentOS or not.
– serenesat
Aug 17 '15 at 10:36
Yeah, I don't havesendemailon my workplace's CentOS, we just havesendmail.
– Alexej Magura
Aug 29 '17 at 18:10
add a comment |
With mutt you can simply use:
echo "This is the message body" | mutt -a "/path/to/file_to_attach" -s "subject of message" -- recipient@domain.com
Using mail command:
mail -a /opt/emailfile.eml -s "Email File" user@example.com < /dev/null
-a is used for attachments.
You can use SendEmail:
sendemail -t to@example.com -m "Here is the file." -a attachmentFile
SendEmailis for Ubuntu, so not sure if it will work for CentOS or not.
– serenesat
Aug 17 '15 at 10:36
Yeah, I don't havesendemailon my workplace's CentOS, we just havesendmail.
– Alexej Magura
Aug 29 '17 at 18:10
add a comment |
With mutt you can simply use:
echo "This is the message body" | mutt -a "/path/to/file_to_attach" -s "subject of message" -- recipient@domain.com
Using mail command:
mail -a /opt/emailfile.eml -s "Email File" user@example.com < /dev/null
-a is used for attachments.
You can use SendEmail:
sendemail -t to@example.com -m "Here is the file." -a attachmentFile
With mutt you can simply use:
echo "This is the message body" | mutt -a "/path/to/file_to_attach" -s "subject of message" -- recipient@domain.com
Using mail command:
mail -a /opt/emailfile.eml -s "Email File" user@example.com < /dev/null
-a is used for attachments.
You can use SendEmail:
sendemail -t to@example.com -m "Here is the file." -a attachmentFile
answered Aug 17 '15 at 10:31
serenesatserenesat
9441820
9441820
SendEmailis for Ubuntu, so not sure if it will work for CentOS or not.
– serenesat
Aug 17 '15 at 10:36
Yeah, I don't havesendemailon my workplace's CentOS, we just havesendmail.
– Alexej Magura
Aug 29 '17 at 18:10
add a comment |
SendEmailis for Ubuntu, so not sure if it will work for CentOS or not.
– serenesat
Aug 17 '15 at 10:36
Yeah, I don't havesendemailon my workplace's CentOS, we just havesendmail.
– Alexej Magura
Aug 29 '17 at 18:10
SendEmail is for Ubuntu, so not sure if it will work for CentOS or not.– serenesat
Aug 17 '15 at 10:36
SendEmail is for Ubuntu, so not sure if it will work for CentOS or not.– serenesat
Aug 17 '15 at 10:36
Yeah, I don't have
sendemail on my workplace's CentOS, we just have sendmail.– Alexej Magura
Aug 29 '17 at 18:10
Yeah, I don't have
sendemail on my workplace's CentOS, we just have sendmail.– Alexej Magura
Aug 29 '17 at 18:10
add a comment |
Posting the solution that worked for me in case it can help anyone else, sorry it's so late.
The most reliable way I found for doing this was to include the attachment as base64 in the eml file itself, bellow is an example of the eml contents.
Note 01 : the base64 for the file comes from running the base64 command on linux using the attachment as an argument (should work with any base64 tool)
Note 02 : the string used for the boundary is just nonsense using the date and random upper case letters
Filename : emlfile.eml
From: Sender <sender@email.co.za>
To: recipient01@email.co.za
CC: recipient02@email.co.za
Disposition-Notification-To: recipient01@email.co.za
Subject: Generic Subject
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="19032019ABCDE"
--19032019ABCDE
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Generic Body Copy
--19032019ABCDE
Content-Type: application;
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="MyPdfAttachment.pdf"
*base64 string goes here (no asterix)*
--19032019ABCDE--
Then the filename.eml file can be sent using the command and it will include the attachment
# /usr/sbin/sendmail -t < filename.eml
add a comment |
Posting the solution that worked for me in case it can help anyone else, sorry it's so late.
The most reliable way I found for doing this was to include the attachment as base64 in the eml file itself, bellow is an example of the eml contents.
Note 01 : the base64 for the file comes from running the base64 command on linux using the attachment as an argument (should work with any base64 tool)
Note 02 : the string used for the boundary is just nonsense using the date and random upper case letters
Filename : emlfile.eml
From: Sender <sender@email.co.za>
To: recipient01@email.co.za
CC: recipient02@email.co.za
Disposition-Notification-To: recipient01@email.co.za
Subject: Generic Subject
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="19032019ABCDE"
--19032019ABCDE
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Generic Body Copy
--19032019ABCDE
Content-Type: application;
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="MyPdfAttachment.pdf"
*base64 string goes here (no asterix)*
--19032019ABCDE--
Then the filename.eml file can be sent using the command and it will include the attachment
# /usr/sbin/sendmail -t < filename.eml
add a comment |
Posting the solution that worked for me in case it can help anyone else, sorry it's so late.
The most reliable way I found for doing this was to include the attachment as base64 in the eml file itself, bellow is an example of the eml contents.
Note 01 : the base64 for the file comes from running the base64 command on linux using the attachment as an argument (should work with any base64 tool)
Note 02 : the string used for the boundary is just nonsense using the date and random upper case letters
Filename : emlfile.eml
From: Sender <sender@email.co.za>
To: recipient01@email.co.za
CC: recipient02@email.co.za
Disposition-Notification-To: recipient01@email.co.za
Subject: Generic Subject
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="19032019ABCDE"
--19032019ABCDE
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Generic Body Copy
--19032019ABCDE
Content-Type: application;
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="MyPdfAttachment.pdf"
*base64 string goes here (no asterix)*
--19032019ABCDE--
Then the filename.eml file can be sent using the command and it will include the attachment
# /usr/sbin/sendmail -t < filename.eml
Posting the solution that worked for me in case it can help anyone else, sorry it's so late.
The most reliable way I found for doing this was to include the attachment as base64 in the eml file itself, bellow is an example of the eml contents.
Note 01 : the base64 for the file comes from running the base64 command on linux using the attachment as an argument (should work with any base64 tool)
Note 02 : the string used for the boundary is just nonsense using the date and random upper case letters
Filename : emlfile.eml
From: Sender <sender@email.co.za>
To: recipient01@email.co.za
CC: recipient02@email.co.za
Disposition-Notification-To: recipient01@email.co.za
Subject: Generic Subject
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="19032019ABCDE"
--19032019ABCDE
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Generic Body Copy
--19032019ABCDE
Content-Type: application;
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="MyPdfAttachment.pdf"
*base64 string goes here (no asterix)*
--19032019ABCDE--
Then the filename.eml file can be sent using the command and it will include the attachment
# /usr/sbin/sendmail -t < filename.eml
answered 12 hours ago
TrentTrent
1,39181634
1,39181634
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f223636%2fsendmail-attachment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Use
uuencodeormutt.– serenesat
Aug 17 '15 at 10:11
I was hoping to use something more like Content-Disposition: attachment but I can't get it to work
– Trent
Aug 17 '15 at 10:13
Do you want some text AND attachment OR attachment only? ["attachment only" case is trivial ]
– AnFi
Aug 17 '15 at 11:25
I'd like to send body copy and the attachment, preferably using sendmail and the eml file with Content-Disposition
– Trent
Aug 17 '15 at 11:31
In such case the most simple is to use email client e.g. mutt
– AnFi
Aug 17 '15 at 17:39