Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Sending mail with Java

Reply
Thread Tools

Sending mail with Java

 
 
Beckam
Guest
Posts: n/a
 
      06-10-2008
I would like to know how to send a mail in a java application
I searched on the web and I found some codes but it always don't
work , because i don't have the name of a mail server
i tried this :
" props.put("mail.smtp.host", "smtp.gmail.com"); "
but it doesn't work ...
if any one could help me , i will be very gratefull
Thanks
 
Reply With Quote
 
 
 
 
David Segall
Guest
Posts: n/a
 
      06-10-2008
Beckam <(E-Mail Removed)> wrote:

>I would like to know how to send a mail in a java application
>I searched on the web and I found some codes but it always don't
>work , because i don't have the name of a mail server
>i tried this :
>" props.put("mail.smtp.host", "smtp.gmail.com"); "
>but it doesn't work ...
>if any one could help me , i will be very gratefull

It will never work without a mail (SMTP) server. I note that you are
using gmail but perhaps your ISP provides access to an SMTP server. If
you can use a standard email client like Outlook or Thunderbird to
send an email you can copy the name of the SMTP server from it.
Otherwise, you will have to install an SMTP server on your own
computer or network. Most ISPs make this as difficult as possible
because it is a common source of spam.
 
Reply With Quote
 
 
 
 
Dave Miller
Guest
Posts: n/a
 
      06-10-2008
Beckam wrote:
> I would like to know how to send a mail in a java application
> I searched on the web and I found some codes but it always don't
> work , because i don't have the name of a mail server
> i tried this :
> " props.put("mail.smtp.host", "smtp.gmail.com"); "
> but it doesn't work ...
> if any one could help me , i will be very gratefull
> Thanks

If you do not have an smtp server on your computer, you'll need to use
your ISP or some other mail server that accepts outbound mail from your
ip. i.e.
props.put("mail.smtp.host", "smtp.your_isp.com");
--
Dave Miller
Java Web Hosting at:
http://www.cheap-jsp-hosting.com/
 
Reply With Quote
 
mich
Guest
Posts: n/a
 
      06-10-2008

"Beckam" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I would like to know how to send a mail in a java application
> I searched on the web and I found some codes but it always don't
> work , because i don't have the name of a mail server
> i tried this :
> " props.put("mail.smtp.host", "smtp.gmail.com"); "
> but it doesn't work ...
> if any one could help me , i will be very gratefull
> Thanks


Seems to me that without a mail server you can't send mail.


 
Reply With Quote
 
Roland de Ruiter
Guest
Posts: n/a
 
      06-10-2008
On 10-6-2008 16:39, Beckam wrote:
> I would like to know how to send a mail in a java application
> I searched on the web and I found some codes but it always don't
> work , because i don't have the name of a mail server
> i tried this :
> " props.put("mail.smtp.host", "smtp.gmail.com"); "
> but it doesn't work ...
> if any one could help me , i will be very gratefull
> Thanks


You'll have to set up a secure connection (SSL) if you want to send mail
through GMail's SMTP server.

For example code, see
<http://forum.java.sun.com/thread.jspa?threadID=668779#9998032>

[Author claims it "works perfectly fine", but I haven't tried the code
myself]
--
Regards,

Roland
 
Reply With Quote
 
Dave Miller
Guest
Posts: n/a
 
      06-10-2008
mich wrote:
> "Beckam" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I would like to know how to send a mail in a java application
>> I searched on the web and I found some codes but it always don't
>> work , because i don't have the name of a mail server
>> i tried this :
>> " props.put("mail.smtp.host", "smtp.gmail.com"); "
>> but it doesn't work ...
>> if any one could help me , i will be very gratefull
>> Thanks

>
> Seems to me that without a mail server you can't send mail.
>
>

Every e-mail client in the world sends e-mail via an outside mail server
- generally provided by the ISP that also connects the user to the net.

--
Dave Miller
Java Web Hosting at:
http://www.cheap-jsp-hosting.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0 HoustonComputerGuy@gmail.com ASP .Net 4 09-28-2007 03:57 PM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
Sending Mail via System.Net.Mail problem =?Utf-8?B?T3Bh?= ASP .Net 3 01-31-2006 06:44 PM
Sending e-mail with attachments with the default e-mail client =?ISO-8859-1?Q?Andr=E9s_Berenguer?= Java 0 08-29-2003 02:28 PM



Advertisments