Sponsored Content
Top Forums UNIX for Advanced & Expert Users Regarding help in sendmail command Post 302978863 by RavinderSingh13 on Friday 5th of August 2016 02:22:49 AM
Old 08-05-2016
Quote:
Originally Posted by stomp
Code:
sendmail_touser() { 
cat - ${Input_file_HTML} << EOF | /usr/sbin/sendmail -oi -t 
From: ${MAILFROM} 
To: ${MAILTO} 
Subject: $1 
Content-Type: text/html; charset=us-ascii 
cat ${Input_file_HTML} 
Content-Transfer-Encoding: 7bit 
MIME-Version: 1.0 
Content-Disposition: attachment; filename: ${Input_file_HTML} 
EOF 
}

AFAIU the colored cat is not being evaluated. If you like to have it done, you should use command expansion
Code:
cat - <<EOF
...
$( cat ${input_file_HTML} )
...
EOF

input_file_HTML should be exported too, to be available in the subshell.
My E-Mail(roundcube) client does not display the mail as probably wanted. The header fields are shown as Mailbody.
Hello stomp,

Yes, I have tried but still it is putting code as in form of text into email as follows.
Code:
Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Content-Disposition: attachment; filename: 
Input_file_HTML

So it is taking that code as a text and printing it before Input_file_HTML's data into email.

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sendmail command

Hi I am using the sendmail command for sending mails. I have a requirement where i call this sendmail command with the mail text.However this mail should be delivered to the recipients only 15 minutes later.Till that point of time it should be in the queue.Is it possible.If so what should i... (4 Replies)
Discussion started by: xsriniva
4 Replies

2. UNIX for Advanced & Expert Users

Sendmail command

Can anyone tell me? How can i attach the file using sendmail command? Give me one example. (2 Replies)
Discussion started by: kingganesh04
2 Replies

3. Shell Programming and Scripting

Command line problems with sendmail

I cannot get this shell script to work. The path to sendmail is correct... #!/bin/bash echo -e "Subject: email subject\n\nemailbody" | /usr/sbin/sendmail -F fromemail@somedomain.com -t recipientemail@somedomain.com (1 Reply)
Discussion started by: limmer
1 Replies

4. UNIX for Advanced & Expert Users

Sendmail with attachment command line ?

hi.. Could somebody guide me how to send mail with attachment using sendmail command in unix ? Thank you, (2 Replies)
Discussion started by: bh_hensem
2 Replies

5. UNIX for Dummies Questions & Answers

Sendmail command options question

Hello, I am trying to use sendmail with spesific usage I am trying to tail a file and send it from an address to my personal mail I am doing so with this command: tail -c 60000 test | sendmail -f sender@domain.com my@mail.com This is working great. I am trying to add this command a... (4 Replies)
Discussion started by: Amit86
4 Replies

6. UNIX for Dummies Questions & Answers

Does the mail command use sendmail?

The question is, Does the mail comman actually send using sendmail or something else? So I am trying to test if sendmail is set up. I used... cat testemail.txt | mail -s "test mail" myemail@test.com I used my email though I didn't get an error, but didn't get the email either. ... (2 Replies)
Discussion started by: wondernate
2 Replies

7. AIX

How to send attachment using "sendmail" command or without uuencode command

Hi Guys, I dont have uuencode, mutt, base64 command available on my aix machine there is any alternative way to send file as attachement in mail. (1 Reply)
Discussion started by: ns64110
1 Replies

8. Shell Programming and Scripting

Sending attachment using sendmail command

Send_Mail() { C_Date=`date +"%m/%d/%Y"` #Subject="MMDB Load Job Status" for i in `cat $Metafile` do if then email_address=`echo $i | cut -d":" -f2` /usr/lib/sendmail "$email_address" < $Email_File fi done } this is the send mail command i am using .please let me... (1 Reply)
Discussion started by: Alok K Yadav
1 Replies

9. Red Hat

-bash: sendmail: command not found

Hello Experts, I have been trying to send a test mail in our linux server with sendmail command.But I am getting command not found error message. -->when I tried whether sendmail installed or not with the command rpm -qa sendmail* I got the below, sendmail-cf-8.14.4-8.el6.noarch... (26 Replies)
Discussion started by: Devipriya Ch
26 Replies

10. Shell Programming and Scripting

Sendmail command truncating to list

Hey Folks - I'm trying to pass a list of To address using sendmail command but upon executing the script the to list gets truncated and not able to send the last sender : -bash-4.3$ ./akt.sh Date : 03-JUL-18 aaaaa.sss#bgttecre.bom trcikant.shrivas#bgttecre.bom abc#xyz.bom pqr#lmn.bom lion... (0 Replies)
Discussion started by: vyomdev
0 Replies
XDG-EMAIL(1)															      XDG-EMAIL(1)

NAME
xdg-email - command line tool for sending mail using the user's preferred e-mail composer SYNOPSIS
xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text] [--attach file] [mailto-uri address(es)] xdg-email {--help --manual --version} DESCRIPTION
xdg-email opens the user's preferred e-mail composer in order to send a mail to address(es) or mailto-uri. RFC2368 defines mailto: URIs. xdg-email limits support to, cc, subject and body fields in mailto-uri, all other fields are silently ignored. address(es) must follow the syntax of RFC822. Multiple addresses may be provided as separate arguments. All information provided on the command line is used to prefill corresponding fields in the user's e-mail composer. The user will have the opportunity to change any of this information before actually sending the e-mail. xdg-email is for use inside a desktop session only. It is not recommended to use xdg-email as root. See http://portland.freedesktop.org/EmailConfig for information on how the user can change the e-mail composer that is used. OPTIONS
--utf8 Indicates that all command line options that follow are in utf8. Without this option, command line options are expected to be encoded according to locale. If the locale already specifies utf8 this option has no effect. This option does not affect mailto URIs that are passed on the command line. --cc address Specify a recipient to be copied on the e-mail. --bcc address Specify a recipient to be blindly copied on the e-mail. --subject text Specify a subject for the e-mail. --body text Specify a body for the e-mail. Since the user will be able to make changes before actually sending the e-mail, this can be used to provide the user with a template for the e-mail. text may contain linebreaks. --attach file Specify an attachment for the e-mail. file must point to an existing file. Some e-mail applications require the file to remain present after xdg-email returns. --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. ENVIRONMENT VARIABLES
xdg-email honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-email do more verbose reporting on stderr. Setting a higher value increases the verbosity. EXIT CODES
An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. CONFIGURATION
Visit http://portland.freedesktop.org/EmailConfig for information how to configure xdg-email to use the email client of your choice. EXAMPLES
xdg-email 'Jeremy White <jwhite@example.com>' xdg-email --attach /tmp/logo.png --subject 'Logo contest' --body 'Attached you find the logo for the contest.' 'jwhite@example.com' xdg-email --subject 'Your password is about to expire' 'jwhite@example.com' 'bastian@example.com' 'whipple@example.com' AUTHOR
Kevin Krammer, Jeremy White. <kevin.krammer@gmx.at> <jwhite@codeweavers.com> xdg-utils 1.0 06/24/2007 XDG-EMAIL(1)
All times are GMT -4. The time now is 07:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy