Sendmail
Hi
I need to send a mail from a java program using the sendmail program.. But i a m not getting it right...and there is no man available in the machine...Its a linux machine.. i typed the below at command prompt.. sendmail -bt -f Sherlock -v Sherlock@xyz.com and this was the result ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter <ruleset> <address> I killed it... Also how to define the message and the subject in the mail... |
Quote:
Hai Sherlock, add your mail server to the /etc/hosts like : 192.168.0.84 mailserver mailserver.domain.fulladdress go to the vi /etc/mail/sendmail.cf grep for the word DS and change it like DSmailserver where mailserver is the alias name set in hosts file. and try sending the mail now.. let me know if u have any errors. Yusuf |
Hi
I tried it the below way sendmail Sherlock@xyz.com<Mail.txt And the mail.txt contains date : ... To : x@y.com Subject : .. from : Z@G.com body of the message From command line....it is working fine... But i am having problem executing it from the java program.. String cmd="/usr/sbin/sendmail xyz@SS.com <Mail.txt"; try { Runtime.getRuntime().exec(cmd); } catch (IOException ioe) { System.out.println(" exception while sending the mails "); ioe.printStackTrace(); } Regards |
Able to send the message but
How to send an attachment using sendmail -a option doesnt exists in this version of linux... |
All times are GMT -5. The time now is 03:48 PM. |