SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    May 2005
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gmail hosted with java

    i All,

    I switched to gmail hosted service.
    Previously I had my account at gmail for example asdf@gmail.com

    My program would send emails using the code:

    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

    boolean debug = true;

    Poperties props = new Properties();
    props.put("mail.smtp.host", "smtp.gmail.com");
    props.put("mail.smtp.auth", "true");
    props.put("mail.debug", "true");
    props.put("mail.smtp.port", "465");
    props.put("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.socketFactory.class",
    "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.socketFactory.fallback", "false");

    Session session = Session.getDefaultInstance(props, new
    javax.mail.Authenticator()
    {
    protected PasswordAuthentication
    getPasswordAuthentication()
    {
    return new PasswordAuthentication("login", "pwd");
    }
    }

    now I have asdf@mycompany.com I still use gmail. In this case how the
    above configuration is going to look like?

    Thanks!

  2. #2
    Non-Member QiSoftware's Avatar
    Join Date
    Oct 2004
    Location
    U.S.
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That send for GMail worked?

    Q...

  3. #3
    SitePoint Addict
    Join Date
    May 2005
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes it did.

  4. #4
    SitePoint Addict
    Join Date
    May 2005
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so in this case will it still be smtp.gmail.com?
    Thanks.

  5. #5
    SitePoint Addict
    Join Date
    May 2005
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I am stil investigating on this topic.

    thanks.

  6. #6
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In Gmail you can set the return-address, so send mail using your domain name. Go to Settings > Accounts, and add your new address. This address is displayed to the user when you send mail. The headers will probably still mention your gmail address. I haven't tried this, but it might just work for you!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •