sending mail


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sending mail
# 8  
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
# 9  
Old 05-12-2009
Quote:
Originally Posted by haris
How do we check that SMTP relaying is enabled or not for any server?

thanks in advance,
haris
Procedure to check is already there in my last message.
# 10  
Old 05-12-2009
I have tried below things

telnet <Outbound SMTP Relay Server>:25
telnet <Outbound SMTP uxmum12>:25
telnet <Outbound SMTP 202.1.121.132>
telnet <Outbound SMTP 202.1.121.132>:25
telnet <Outbound SMTP uxmum12>:25
telnet <Outbound SMTP uxmum12>

uxmum12 i.e my hostname and 202.1.121.132 my servers ip .
I have tried all these combinations but it gives me this error

ksh: Outbound: cannot open

for any ideas please reply on this

thanks in advance,
haris
# 11  
Old 05-12-2009
Hi,

If your smtp server name is abc.test.com the command you should use is

telnet abc.test.com 25

you have to execute this from the server where you are trying to send email.
# 12  
Old 05-13-2009
thanks krrishv for your inputs

I have tried both the things

first the hostname i.e my server name and then its ip but it gives me below error

uxmum12: /trimsbld/users/harishc> telnet uxmum12 25
Trying...
telnet: Unable to connect to remote host: Connection refused
uxmum12: /trimsbld/users/harishc> telnet 202.1.121.132 25
Trying...
telnet: Unable to connect to remote host: Connection refused

any suggestions on this

thanks in advance,
haris
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question