LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2007, 12:12 AM   #1
Sherlock
Member
 
Registered: Mar 2004
Location: India
Distribution: RedHat Linux 8
Posts: 60

Rep: Reputation: 15
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...
 
Old 11-13-2007, 01:32 AM   #2
yusufs
Member
 
Registered: Oct 2007
Posts: 162

Rep: Reputation: 30
Quote:
Originally Posted by Sherlock View Post
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...


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
 
Old 11-13-2007, 04:45 AM   #3
Sherlock
Member
 
Registered: Mar 2004
Location: India
Distribution: RedHat Linux 8
Posts: 60

Original Poster
Rep: Reputation: 15
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
 
Old 11-13-2007, 11:36 PM   #4
Sherlock
Member
 
Registered: Mar 2004
Location: India
Distribution: RedHat Linux 8
Posts: 60

Original Poster
Rep: Reputation: 15
Able to send the message but

How to send an attachment using sendmail

-a option doesnt exists in this version of linux...

Last edited by Sherlock; 11-14-2007 at 03:33 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail config questions + Sendmail not reflecting changes to access db wbuik Linux - Networking 2 03-26-2009 05:02 AM
Where do I edit attachment size in sendmail.cf or sendmail.mc deepak_message Linux - Software 1 10-23-2007 07:51 PM
sendmail is not working & on $prompt the cmd sendmail hangs Pavan mahoorker Linux - Software 1 04-04-2006 03:57 PM
php+ sendmail no good - python + sendmail ok nephish Linux - Networking 1 10-07-2005 01:19 PM
Sendmail - RunAsUser=sendmail:mail/What files to i have to change ForumKid Linux - Security 45 01-18-2002 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration