Unable to send the email in formatted way


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Unable to send the email in formatted way
# 8  
Old 08-25-2014
Why are you using "Content-Type: text/html", since you are not using html to format the email? Try leaving it out or try using "Content-Type: text/plain".
# 9  
Old 08-25-2014
@Srinishoo

I am getting the below error

Code:
awk: syntax error near line 1
awk: bailing out near line 1
No recipient addresses found in header

---------- Post updated at 05:08 PM ---------- Previous update was at 05:04 PM ----------

@Scrutinizer,
I tried plain content-type; but is same email without new line.
# 10  
Old 08-25-2014
You haven't said what OS you're using. If you using Solaris/SunOS, change awk to /usr/xpg4/bin/awk in the script.
This User Gave Thanks to Don Cragun For This Post:
# 11  
Old 08-26-2014
@Don Cragun,
sorry i missed that info part. it is SunOS.

Awk error is no more existing now after changing it to
Code:
/usr/xpg4/bin/awk

The new error came now, despite of giving From and To:
I am getting the below error now

Code:
No recipient addresses found in header

# 12  
Old 08-26-2014
Provide us the entire script (masking sensitive data) so that we can look into for errors

---------- Post updated at 11:24 PM ---------- Previous update was at 11:21 PM ----------

But the error you have provided tells that you have missed To part
If you are using the script as it is, assign the 'To' address to MAILTO variable
# 13  
Old 08-26-2014
How are Filename, MAILFROM, MAILTO, and SUBJECT set when you get to the here-document in your script?
# 14  
Old 08-26-2014
Here is entire code

Code:
/usr/xpg4/bin/awk 'BEGIN{print "<pre>"}1' ORS='<br>' ${FILE}.txt <<EOF | /usr/sbin/sendmail -oi -t
From: abc@xyz.com
To: def@xyz.com
Subject: GAP Report
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
EOF

2nd time i tried as below; but error was same

Code:
MAILFROM=`hostname`
MAILTO='def@xyz.com'
/usr/xpg4/bin/awk 'BEGIN{print "<pre>"}1' ORS='<br>' ${FILE}.txt <<EOF | /usr/sbin/sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: GAP Report
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
EOF

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

Unable to send email using Java in Linux

Hi All, We recently moved to Red Hat Enterprise Linux Server release 6.6 from Solaris 10. The existing Java code to send emails in Solaris is public class card_cardMessenger{ /** * Send an e-mail message via the Runtime class * @see Runtime * @return boolean (success or failure of... (1 Reply)
Discussion started by: Meghan2525
1 Replies

2. Shell Programming and Scripting

Shell scripting unable to send the sql query data in table in body of email

I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email. spool table_update.html; SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription'; spool off; exit; Please use code tags next time for your code and data.... (9 Replies)
Discussion started by: Sharanakumar
9 Replies

3. Linux

Unable to send email with sendmail from PHP 5.3 on CentOS VM

I have a longstanding issue on my CentOS 5.6 VM where I am unable to send email from my PHP application. This is the last bunch of lines from my /var/log/maillog file. Feb 14 10:29:16 dev53 sendmail: s1EATEEo004637: Authentication-Warning: www.craig.dev-crmpicco.lan: apache set sender to... (2 Replies)
Discussion started by: crmpicco
2 Replies

4. Shell Programming and Scripting

urgent: Not able to send the html formatted message from mailx

<html> <body style=background-color:AliceBlue> <p>Hi,<pre>please check the connectivity status of the server. <pre> And find the server log file for more details. </p> <h1><font size="4">SERVER <font color="red">111.111.11.1</font> IS NOT AVAILABLE IN ONLINE</font></h1> <font color="red"... (5 Replies)
Discussion started by: jothi basu
5 Replies

5. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

6. Solaris

Unable to send email to the outside world

Hi all, Iam unable to send mail from my unix machine(solaris x86,version 5.10) to the outside world. I can able to access the internet,but not able to send to any yahoo or company email id. Before posting this,i have searched this forum many times,but could not get the results what i... (5 Replies)
Discussion started by: jayaprakash
5 Replies

7. Shell Programming and Scripting

unable to send an email attachment

i know its pretty repeated query, but i need to post it in this new thread coz i need it urgently uuencode /var/tmp/chandra/emaillist.txt emaillist.txt | mail -s "message with encoded attachment" am unable to send the attachment emaillist.txt present in the path /var/tmp/chandra/ Is... (11 Replies)
Discussion started by: cmaroju
11 Replies

8. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
Login or Register to Ask a Question