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!
That send for GMail worked?
Q...
so in this case will it still be smtp.gmail.com?
Thanks.
Hi,
I am stil investigating on this topic.
thanks.
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!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks