tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Farrow" <marc.far...@gmail.com>
Subject Re: javamail + tomcat
Date Mon, 28 Aug 2006 12:17:13 GMT
Ovi,
  Do you know the email address?  If so, then use JNDI and do a NSLOOKUP for
MX records on the domain name.

for example:

if you want to send mail to someuser@gmail.com, then do a nslookup for MX
records on gmail.com.  From the command prompt it is:

nslookup -type=mx gmail.com

This will return several MX servers.  Loop through those using the lowest
numbered priority first.  You will need to do a search on how to do
nslookups with JNDI.

HTH

On 8/25/06, Ovi Comes <ovi@netspedition.com> wrote:
>
> Thanks Marc but how can I determine a valid MX entry for each email I
> send?
> I don't think that's viable solution since I don't know the target
> subscribers a priori.
>
>
>
> -----Original Message-----
> From: Marc Farrow [mailto:marc.farrow@gmail.com]
> Sent: Friday, August 25, 2006 5:01 PM
> To: Tomcat Users List
> Subject: Re: javamail + tomcat
>
> I am sure you can use a Mail session in Tomcat and set it up the same way,
> but I am calling javamail directly.
>
> if I am sending to gmail.com.  I would use this code..
>
>      Properties props = new Properties();
>      props.put("mail.smtp.host","gmail-smtp-in.l.google.com");
>      props.put("mail.smtp.localhost", "localhost");
>      Session s = Session.getInstance(props,null);
>      s.setDebug(true);
>      MimeMessage message = new MimeMessage(s);
>      message.setSubject(getSubject());
>      message.setFrom(InternetAddress.parse("marc.farrow@gmail.com")[0]);
>      message.setRecipient(Message.RecipientType.TO,"anyone@gmail.com");
>      message.setText("this is a test message");
>      Transport.send(message);
>
>
>
> On 8/25/06, Propes, Barry L <barry.l.propes@citigroup.com> wrote:
> >
> > I'll sure take that under advisement.
> >
> > Tomcat has an additional component for sending email? I don't think I
> ever
> > knew that. Where's it configured? In the server.xml file?
> >
> > -----Original Message-----
> > From: Marc Farrow [mailto:marc.farrow@gmail.com]
> > Sent: Friday, August 25, 2006 3:52 PM
> > To: Tomcat Users List; ovi@netspedition.com
> > Subject: Re: javamail + tomcat
> >
> >
> > If you want to send email directly via Tomcat, you can bypass relaying.
> > Just set the "mail.smtp.host" attribute to a valid MX entry for the
> > receiving domain.
> >
> >
> >
> > On 8/25/06, Ovi Comes <ovi@netspedition.com> wrote:
> > >
> > > That is interesting. The funny thing is that I could send email to any
> > > account inbox. That is, running the code standalone. I can't figure
> out
> > > how
> > > Tomcat would possibly alter my email so that it ends up in the spam
> box.
> > > Plus, the headers are identical!
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Propes, Barry L [mailto:barry.l.propes@citigroup.com]
> > > Sent: Friday, August 25, 2006 4:08 PM
> > > To: Tomcat Users List; ovi@netspedition.com
> > > Subject: RE: javamail + tomcat
> > >
> > > most likely you have to get relaying approved.
> > >
> > > I've had a similar problem and had to jettison the idea of JavaMail
> for
> > > now,
> > > due to the relaying problem.
> > >
> > > I could send through my desktop and only my email address through my
> ISP
> > > would receive it, and then only in the Bulk Mail folder!
> > >
> > > Quite an aggravation, and I never found from anyone anywhere, short of
> > > seeing the administrator, how to solve this problem.
> > >
> > > Problem for me was twofold:
> > > 1) how I do get my ISP to let other email addresses approved?
> > > 2) getting an email admin here at work to approve this was like
> getting
> > > Iran
> > > to concede on every nuclear point the U.S. or U.N. wants to adopt!
> > >
> > > -----Original Message-----
> > > From: Ovi Comes [mailto:ovi@netspedition.com]
> > > Sent: Friday, August 25, 2006 3:04 PM
> > > To: users@tomcat.apache.org
> > > Subject: javamail + tomcat
> > >
> > >
> > > Hi,
> > >
> > >
> > >
> > > I need help with javamail in tomcat. Here is my issue: if send an
> email
> > to
> > > an yahoo account, from my junit class everything is ok. When I run the
> > > same
> > > code in Tomcat, on the same machine, my email goes to spam/bulk
> folder.
> > > What
> > > is going on?
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Ovi
> > >
> > >
> > > --
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date:
> > 8/24/2006
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
> > >
> > > --
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition.
> > > Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date:
> > 8/24/2006
> > >
> > >
> > > --
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date:
> > 8/24/2006
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
> >
> >
> > --
> > Marc Farrow
> >
>
>
>
> --
> Marc Farrow
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date: 8/24/2006
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.11.6/427 - Release Date: 8/24/2006
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Marc Farrow

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message