Java mail problem

Discussion in 'Java' started by nialltimpson, Apr 5, 2005.

  1. nialltimpson

    nialltimpson Guest

    The following gives off no error's but doesnt send the mail any idea's?

    public void mailPass(){
    try{
    Properties props = new Properties();
    props.put("mail.host","149.153.100.8");

    Session mailConnection = Session.getInstance(props, null);
    Message msg = new MimeMessage(mailConnection);

    Address bill = new InternetAddress("","Tech
    Support");
    Address customer = new InternetAddress("");
    System.err.println("setup mail");
    msg.setContent("You Password For WWW.eScratchCard.ie is : ",
    "text/plain");
    msg.setFrom(bill);
    msg.setRecipient(Message.RecipientType.TO,customer);
    msg.setSubject("Your eScratchCards Passwrord");

    Transport.send(msg);
    }
    catch(Exception e ){e.printStackTrace();}
    }

    I would appreceate any help, thanks Niall
     
    nialltimpson, Apr 5, 2005
    #1
    1. Advertising

  2. nialltimpson

    Andy Flowers Guest

    nialltimpson wrote:
    > The following gives off no error's but doesnt send the mail any
    > idea's?
    >
    > public void mailPass(){
    > try{
    > Properties props = new Properties();
    > props.put("mail.host","149.153.100.8");
    >
    > Session mailConnection = Session.getInstance(props, null);
    > Message msg = new MimeMessage(mailConnection);
    >
    > Address bill = new InternetAddress("","Tech
    > Support");
    > Address customer = new InternetAddress("");
    > System.err.println("setup mail");
    > msg.setContent("You Password For WWW.eScratchCard.ie is : ",
    > "text/plain");
    > msg.setFrom(bill);
    > msg.setRecipient(Message.RecipientType.TO,customer);
    > msg.setSubject("Your eScratchCards Passwrord");
    >
    > Transport.send(msg);
    > }
    > catch(Exception e ){e.printStackTrace();}
    > }
    >
    > I would appreceate any help, thanks Niall


    What is the error ?
     
    Andy Flowers, Apr 5, 2005
    #2
    1. Advertising

  3. nialltimpson

    nialltimpson Guest

    It doesnt throw off an error, the mail message just isnt being sent!, that
    what I cant get my head around
     
    nialltimpson, Apr 5, 2005
    #3
  4. nialltimpson

    GaryM Guest

    "nialltimpson" <> wrote in
    news:
    m:

    >
    > I would appreceate any help, thanks Niall
    >
    >


    msg.saveChanges(); before your Transport.send(msg).
     
    GaryM, Apr 5, 2005
    #4
  5. nialltimpson

    shakah Guest

    I think Javamail dumps verbose debug messages if you add a "mail.debug"
    property set to "true" to the Properties used in call to
    Session.getInstance(). You can probably do this by setting the property
    on the command line or in the environment also, though I'm not sure.
     
    shakah, Apr 5, 2005
    #5
  6. nialltimpson

    nialltimpson Guest

    >> msg.saveChanges(); before your Transport.send(msg).

    thank you very very much,
    Have a very good night

    Niall
     
    nialltimpson, Apr 5, 2005
    #6
  7. nialltimpson

    Ike Guest

    Not sure you've gotten this working or note, but I had the same problem
    regarding SENDING via JavaMail, until I finally set the mail.smtp.host
    property with :

    props.put("mail.smtp.host",...);

    -Ike
     
    Ike, Apr 8, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TXJGZXo=?=

    Mail message size problem (System.Web.Mail)

    =?Utf-8?B?TXJGZXo=?=, Mar 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    642
    =?Utf-8?B?TXJGZXo=?=
    Mar 14, 2005
  2. =?Utf-8?B?TWlja2VCb3k=?=

    Problem with System.Web.Mail.MailMessage and HTML mail

    =?Utf-8?B?TWlja2VCb3k=?=, Jun 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    914
    =?Utf-8?B?TWlja2VCb3k=?=
    Jun 21, 2005
  3. =?Utf-8?B?T3Bh?=

    Sending Mail via System.Net.Mail problem

    =?Utf-8?B?T3Bh?=, Jan 25, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    3,606
    sachya
    Jan 31, 2006
  4. Brad
    Replies:
    2
    Views:
    10,233
  5. Replies:
    0
    Views:
    1,377
Loading...

Share This Page