Hi How to Send Email Locally(Localhost)

23 views
Skip to first unread message

Opcenter [N1] Support

unread,
Sep 5, 2011, 7:35:46 AM9/5/11
to google-a...@googlegroups.com
HI ,
I want to send email . if i send email locally(localhost) , its not working. But its working when app on server.
Here is the code i used in my apps
Message msg = new MimeMessage(session);  
                msg.setFrom(new InternetAddress("x...@gmail.com"));
                msg.addRecipient(Message.RecipientType.TO,    new InternetAddress("x...@gmail.com","Mr. User"));
            
                msg.setSubject(subject);     
                msg.setContent(content, "text/html");
                Transport.send(msg); 

Is there Any way to send ?

Thanks in Advance

Ernesto Oltra

unread,
Sep 5, 2011, 5:14:35 PM9/5/11
to google-a...@googlegroups.com
Hi,
Email can't be send automatically from your computer. You have three options here:

1) Use the flag --enable_sendmail and install & config sendmail in your computer.

2) Use --show_mail_body and check the mail contents in the console.

3) Use --smtp_host=smtp.gmail.com --smtp_use=myac...@gmail.com --smtp_password=mypasswordhere. This approach has some drawbacks like having to write your password in plain text in the console and the emails goes directly to spam because they're not signed, but at least it works out of the box!

Ernesto
Reply all
Reply to author
Forward
0 new messages