Sponsored Content
Full Discussion: sending mail
Top Forums UNIX for Dummies Questions & Answers sending mail Post 302315274 by sowmya005 on Tuesday 12th of May 2009 03:23:29 AM
Old 05-12-2009
Hi Haris,
I hope you can check by trying sending normal mail.
Only if malx or sendmail (whatever you are using) on your server is configured to send mails to any mail id, you can send a mail. Or else you will be able to send mail only to yourself or your local hosts.
Then you can try sending mail with an attachment.
I have written a script that sends mail with html content (not attachment).

#!/usr/bin/ksh
MTA=/usr/lib/sendmail
VERSION=1.0
fromuser=abc
myDate="Fri Dec 5 14:47:09 IST 2008"
Username=abc
tomail="abc@xyz.com"
{
echo "From: abc"
echo "To:abc@xyz.com "
echo "Subject: Automation Results"
echo "Cc:"
echo "X-Mailer: htmlmail" 1.0
echo "Mime-Version: 1.0"
echo "Content-Type: text/html; charset=US-ASCII"
echo
echo "<right><p> Hi,</p>"
echo "<head><title>MailHeader</title></head>"
echo "<body bgcolor="white">"
echo "<center> <h1> Automation Results</h1> </center>"
echo "<br>"
echo "<left><p>######################### VALIDATION REPORT #########################</p>"
echo "<left><p> D check : PASS</p>"
echo "<left><p> F check : PASS</p>"
echo "<left><p> C check : PASS</p>"
echo "<left><p> R check : PASS</p>"
echo "<left><p> E check : PASS</p>"
echo "<left><p>#####################################################################</p>"
echo "<left><p> Thanks,</p>"
echo "<left><p> abc</p>"
echo "<p> Note:You have received this mail because your mail id is specified as a part of the Automation Run. </p>"
} | eval /usr/lib/sendmail "abc@xyz.com"

Hope this helps u.
Thanks,
Sowmya
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sending a mail to a mail client

Hi everyone! I'm trying to create a database monitoring script that reads an alert file and sends an error message if it can 'grep' a particular string. Is there a way to send this message to a mail client using SMTP? Even better, is there any place on this site that has these kinds of... (5 Replies)
Discussion started by: solaris73
5 Replies

2. UNIX for Advanced & Expert Users

sending mail

How do I send an email with a subject and an attachment from a command prompt? (3 Replies)
Discussion started by: mskarica
3 Replies

3. Shell Programming and Scripting

Mail sending

Dear all, how can i send mail using mailx or mail command?do i need to configure anything for sending mail?please help me.Its urgent. the version i use is Linux TDM 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Linux Thanks Regards, Pankaj (15 Replies)
Discussion started by: panknil
15 Replies

4. HP-UX

hp ux not sending mail

Hi.. In Hp ux box,, mails are not being sent. they are getting queued up in mail queue. (3 Replies)
Discussion started by: kkhan
3 Replies

5. Ubuntu

help sending mail

Hi, I have kubuntu 8.10 and I would like to configure Ubuntu to can send mail from command line with mailx. I've saw that I need to install a MTA. But I don't know with install and how. Do you know some howto or url where I find how could I configure it? Many thanks and sorry for my... (2 Replies)
Discussion started by: mierdatuti
2 Replies

6. Shell Programming and Scripting

Sending mail

Hi there, How can I send the automated log file, daily at 7 am to the respective mail . Thanks in Advance, Neha (2 Replies)
Discussion started by: NehaKrish
2 Replies

7. Shell Programming and Scripting

Stop sending mail after certain number of mail

Hi guys... I am busy writing a script to notify me via an mail if my application is down. I have done that. Now I want this script to stop sending mails after five mails were sent but the script should keep on checking the application. When the application is up again that count should be... (5 Replies)
Discussion started by: Phuti
5 Replies

8. Shell Programming and Scripting

Sending Mail

Hi All, I have a script that looks like this: *********** #!/bin/sh -x cd /u01/app/oracle/diag/rdbms/spdb/spdb/trace cat alert_spdb.log|grep Archiver >/dev/null if ; then mailx -s "Archiver message in Alert log" user@email.com fi ************ Im using the -x option to see any... (1 Reply)
Discussion started by: oradba888
1 Replies

9. UNIX for Dummies Questions & Answers

Sending mail

How can i send a mail when user login in unix ENV. How can i know present use mailID?? Moved out of Contact Us Forum - Please Do Not Post Technical Questions in Non-Technical Forum(s) (1 Reply)
Discussion started by: arun508.gatike
1 Replies

10. Red Hat

Problems sending mail: Difference between Mail and Mailx?

Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) ... (1 Reply)
Discussion started by: RedSpyder
1 Replies
CURLOPT_MAIL_FROM(3)					     curl_easy_setopt options					      CURLOPT_MAIL_FROM(3)

NAME
CURLOPT_MAIL_FROM - SMTP sender address SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_FROM, char *from); DESCRIPTION
Pass a pointer to a zero terminated string as parameter. This should be used to specify the sender's email address when sending SMTP mail with libcurl. An originator email address should be specified with angled brackets (<>) around it, which if not specified will be added automatically. If this parameter is not specified then an empty address will be sent to the mail server which may cause the email to be rejected. The application does not have to keep the string around after setting this option. DEFAULT
blank PROTOCOLS
SMTP EXAMPLE
TODO AVAILABILITY
Added in 7.20.0 RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO
CURLOPT_MAIL_RCPT(3), CURLOPT_MAIL_AUTH(3), libcurl 7.54.0 December 21, 2016 CURLOPT_MAIL_FROM(3)
All times are GMT -4. The time now is 11:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy