Send mail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Send mail
# 1  
Old 02-17-2014
Send mail

OS:
SunOS

I want to send mail to my email id abc@gmail.com using mail command.
How can i achieve it ?
# 2  
Old 02-17-2014
# 3  
Old 02-17-2014
Hi

I tried these steps
Code:
mailx -s hello abc@tc.com

ddf
d
fd
(ctr+c 2 times )

Getting an error message
Code:
Interrupt -- one more to kill letter)
^C"/arbor/dead.letter" 4/9


Last edited by Scott; 02-17-2014 at 10:01 AM.. Reason: Code tags
# 4  
Old 02-17-2014
Try Ctrl-d instead to end the input. You are cancelling the input.



Robin

Last edited by rbatte1; 02-17-2014 at 07:49 AM.. Reason: Emboldening Ctrl-d
# 5  
Old 02-17-2014
Quote:
Originally Posted by rbatte1
Try Ctrl-d instead to end the input. You are cancelling the input.



Robin
Itried
Code:
 mailx -s hello rraj@telepacific.com
ddf
dfsfgfdg
EOT

But still no mail in my inbox

Last edited by Scott; 02-17-2014 at 10:01 AM.. Reason: Code tags
# 6  
Old 02-17-2014
Is this within a script or on the command line? Within a script, you would need to open the here document to end it with EOT like this:-
Code:
mailx -s hello rraj@<youremailserver>  <<-EOT
ddf
dfsfgfdg
EOT

.....or you could just:-
Code:
mailx -s hello rraj@<youremailserver>  < /tmp/mailfile

.... and put the message in /tmp/mailfile.

If you are doing it all correctly and there are no errors, you will have to look further down the line. Have a look in your sendmail.cf file for the DS record as a starter. Is that uncommented, and does it relay outgoing mail to a suitable server?

If it does, try to connect to the server manually with telnet your-relay-server 25 and see if you can talk with it. The connection is pretty limited, but you should be able to type helo (not a spelling mistake) to get a response. Just quit to disconnect. This will show if there is an open route to the relay server.
Code:
RBATTE1> telnet u-lpl-relay-01 25
Trying...
Connected to my-relay-01.mydomain.
Escape character is '^]'.
220-SMTP Relay
220 Warning: no name found in DNS for your host address
helo
250 OK
quit
221 mydomain closing
Connection closed.
RBATTE1>

Beyond that, you would need to see what happens to incoming mail on the relay server. You can check if you have actually sent anything to it by examining the output of mailq



I hope that this helps,
Robin
Liverpool/Blackburn
UK
This User Gave Thanks to rbatte1 For This Post:
# 7  
Old 02-17-2014
Hi Rbatte,

Thanks for your descriptive reply.
I want to send mail using a script.This is my first time.Whatever you posted above made little sense to me.I will go through that again and again.
One help from you i need is
Can you tell me step by step from the beginning how to send a mail to my company email.

My company email address is ---> abc@company.com
Below command gives me.
more /etc/resolv.conf

Code:
domain  company.com
nameserver 10.70.3.100
nameserver 10.7.2.80

---------- Post updated at 05:55 PM ---------- Previous update was at 05:48 PM ----------

Quote:
Originally Posted by rbatte1
Is this within a script or on the command line? Within a script, you would need to open the here document to end it with EOT like this:-
Code:
mailx -s hello rraj@<youremailserver>  <<-EOT
ddf
dfsfgfdg
EOT

.....or you could just:-
Code:
mailx -s hello rraj@<youremailserver>  < /tmp/mailfile

.... and put the message in /tmp/mailfile.

If you are doing it all correctly and there are no errors, you will have to look further down the line. Have a look in your sendmail.cf file for the DS record as a starter. Is that uncommented, and does it relay outgoing mail to a suitable server?

If it does, try to connect to the server manually with telnet your-relay-server 25 and see if you can talk with it. The connection is pretty limited, but you should be able to type helo (not a spelling mistake) to get a response. Just quit to disconnect. This will show if there is an open route to the relay server.
Code:
RBATTE1> telnet u-lpl-relay-01 25
Trying...
Connected to my-relay-01.mydomain.
Escape character is '^]'.
220-SMTP Relay
220 Warning: no name found in DNS for your host address
helo
250 OK
quit
221 mydomain closing
Connection closed.
RBATTE1>

Beyond that, you would need to see what happens to incoming mail on the relay server. You can check if you have actually sent anything to it by examining the output of mailq



I hope that this helps,
Robin
Liverpool/Blackburn
UK
This gives me
Code:
telnet mycompany.com 25[/B]
Trying 172.10.24.0...


Last edited by Scott; 02-17-2014 at 10:02 AM.. Reason: Fixed code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. Ubuntu

Not able to send mail out of UbuntuBox in send mail

Hi Guys.. yesterday i purchased a VPS server and installed sendmail on ubuntu 12.4 with Webmin & Apache runing webserver problem is.. i can send mail via webmin user interface account to anybody to out side to any domain and able to recieve any mail from any domain.. Now main... (2 Replies)
Discussion started by: cmdman
2 Replies

3. Shell Programming and Scripting

How to send mail using PHP mail function On apache server.?

Hello, I am using centos-6.2 I have apache server,php5 on my system and I want to send mail using sendmail on my system. when I try to send mail from shell that time mail is succesfully sent to respective address() but when I try to send it through webbrowser I am not able to send it.... (1 Reply)
Discussion started by: Kiran ursal
1 Replies

4. UNIX for Advanced & Expert Users

How can I send a mail from my outlook or other mail accounts to UNIX server?

Hi all, I want to send a mail for my business needs from outlook account to an unix server (HP-UX) but I don't send any mail. While I can send from the unix server to my outlook account, I can't send from outlook to unix. How can I achieve this ? How can I send a mail from my outlook or other... (2 Replies)
Discussion started by: igelegin
2 Replies

5. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

6. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

7. UNIX for Advanced & Expert Users

send attachments using send mail in Solaris

Hi All, I have a requirement to send and email of body html with an attachment. concatinating uuencode output to the mail body with mailx command works, but as my Email body is of HTML type i use sendmail. my command to send HTML body is as below: export MAILTO="recipient@domain.com"... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

8. Shell Programming and Scripting

Pull E-mail address from file, send e-mail

Hello, I am new to perl and need to create a script that will read a file and pull a name from the file and send e-mail. How can I use the following awk statement in a perl script? grep UNIXadmins /root/mail.conf | awk '{ print $2}' and use the output to send a e-mail. Any help would... (1 Reply)
Discussion started by: DC Heard
1 Replies

9. UNIX for Dummies Questions & Answers

I am not able to send mail form unix to other mail accounts.

Using Mailx command i.e mailx -s "subject" chinni@hotmail.com < \tmp\chin this command executed sucessfully but not able to receive the mail in chinni@hotmail.com please help. (1 Reply)
Discussion started by: chinnigd
1 Replies

10. UNIX for Dummies Questions & Answers

can not send mail from unix server to company/yahoo mail

hi, Gurus, I need some help with sending mail out from my UNIX server: It is running Solaris 2.6 and the sendmail version is 8.8. Output of :/usr/lib/sendmail -d0.1 -bt < /dev/null Version 8.8.8+Sun Compiled with: LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET ... (5 Replies)
Discussion started by: b5fnpct
5 Replies
Login or Register to Ask a Question