How to send mail with cygwin? | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

How to send mail with cygwin?

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-10-2012
parthmittal2007 parthmittal2007 is offline
Banned
 
Join Date: Dec 2011
Last Activity: 5 March 2013, 1:31 AM EST
Posts: 193
Thanks: 22
Thanked 2 Times in 2 Posts
How to send mail with cygwin?

Hi,
Can anybody help me about how to send a mail with the help of Cygwin(its a tool which provide a Unix environment on windows)
I tried the mailx command but its not working..

---------- Post updated at 11:14 AM ---------- Previous update was at 08:34 AM ----------

any substitute for doing this..
Sponsored Links
    #2  
Old 02-10-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 25 October 2014, 1:15 PM EDT
Location: Saskatchewan
Posts: 19,685
Thanks: 824
Thanked 3,352 Times in 3,139 Posts
In what way is it "not working"?

Did you actually install any MTA? Cygwin doesn't come with every possible command in the universe. If you want something really simple, I suggest ssmtpd, an "imitation" mail-transport agent which is actually a mail client, not a mail server, and sends through one smtp account that you configure.
Sponsored Links
    #3  
Old 02-11-2012
parthmittal2007 parthmittal2007 is offline
Banned
 
Join Date: Dec 2011
Last Activity: 5 March 2013, 1:31 AM EST
Posts: 193
Thanks: 22
Thanked 2 Times in 2 Posts
Hi Corona688
Thanks for the information.I don't well understand the concept.
Can you please give me an example.

Thanks..
    #4  
Old 02-12-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 25 October 2014, 1:15 PM EDT
Location: Saskatchewan
Posts: 19,685
Thanks: 824
Thanked 3,352 Times in 3,139 Posts
I don't understand what you want, ask a more specific question and I'll give a more specific answer.
Sponsored Links
    #5  
Old 02-12-2012
parthmittal2007 parthmittal2007 is offline
Banned
 
Join Date: Dec 2011
Last Activity: 5 March 2013, 1:31 AM EST
Posts: 193
Thanks: 22
Thanked 2 Times in 2 Posts
Thanks for showing the interest.

I have Cygwin installed on my windows also i have updated the cygwin with ssmtp package.
Now what i want to do is-:
I want to send mail with the help of cygwin, suppose i have written a script which is executing and if the script found that the certain condition had met it should send mail the user xyz@gmail.com , that what i actually want to do.

Please help me about this matter.Its really important to me.
Sponsored Links
    #6  
Old 02-12-2012
Aia's Avatar
Aia Aia is offline
Registered User
 
Join Date: May 2008
Last Activity: 25 October 2014, 4:37 PM EDT
Posts: 466
Thanks: 32
Thanked 149 Times in 140 Posts
Quote:
Originally Posted by parthmittal2007 View Post
Thanks for showing the interest.

I have Cygwin installed on my windows also i have updated the cygwin with ssmtp package.
Now what i want to do is-:
I want to send mail with the help of cygwin, suppose i have written a script which is executing and if the script found that the certain condition had met it should send mail the user xyz@gmail.com , that what i actually want to do.

Please help me about this matter.Its really important to me.
If you use ssmtp
edit /etc/ssmtp/ssmtp.conf to have the following:
Quote:
root=xyz@gmail.com

# See also Configuring other mail clients - Gmail Help
mailhub=smtp.gmail.com:587

# The address where the mail appears to come from for user authentification.
rewriteDomain=gmail.com

# The full hostname
hostname=localhost

# Use SSL/TLS before starting negotiation
UseTLS=Yes
UseSTARTTLS=Yes

# Username/Password
AuthUser=xyz@gmail.com
AuthPass=xyx_password

# Email 'From header's can override the default domain?
FromLineOverride=yes
Install email
Edit /etc/email/email.conf to have the following:
Quote:
SENDMAIL_BIN = '/usr/sbin/sendmail -t -i'
MY_NAME = 'CoolGuy'
MY_EMAIL = 'xyz@gmail.com'
REPLY_TO = 'xyz@gmail.com'
After that you should be able use email command to send emails via gmail.


Code:
email -s "It worked!" xyz@gmail < message.file

or

Code:
echo "Cool Guy" | email -s "From The Vault of Awesomeness"


Both email and ssmtp have a configuration script to help you add the settings.
Quote:
email-config
ssmtp-config
However, ssmtp-config doesn't present to you all the settings necessary.

Last edited by Aia; 02-12-2012 at 05:16 PM.. Reason: Because I can
Sponsored Links
    #7  
Old 05-26-2012
nagios nagios is offline
Registered User
 
Join Date: Apr 2012
Last Activity: 2 June 2012, 2:15 AM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Aia View Post
If you use ssmtp
edit /etc/ssmtp/ssmtp.conf to have the following:


Install email
Edit /etc/email/email.conf to have the following:


After that you should be able use email command to send emails via gmail.


Code:
email -s "It worked!" xyz@gmail < message.file

or

Code:
echo "Cool Guy" | email -s "From The Vault of Awesomeness"


Both email and ssmtp have a configuration script to help you add the settings.

However, ssmtp-config doesn't present to you all the settings necessary.
Hi,
I have tried the configuration of email and when i hv tried the code


Code:
email -s "It worked!" xyz@gmail < message.file

It gave an error as

email: FATAL: Could not open attachment: /root/dean.ldif: No such file or directory

Can u help me with this ???
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to send mail with From and to address from specific mail server Dharv Shell Programming and Scripting 1 08-29-2011 11:10 AM
need to configure mail setting to send mail to outlook mail server amitranjansahu UNIX for Advanced & Expert Users 2 02-18-2011 06:29 AM
How to send html file in a mail not as an attachment but it should display in the mail in table for mani_isha UNIX for Dummies Questions & Answers 0 03-30-2010 03:37 AM
send attachments using send mail in Solaris mohan_kumarcs UNIX for Advanced & Expert Users 1 04-25-2009 12:36 PM
can not send mail from unix server to company/yahoo mail b5fnpct UNIX for Dummies Questions & Answers 5 11-22-2002 08:24 PM



All times are GMT -4. The time now is 04:38 PM.