Hi Abhiram, You can only send an email using a SMTP server that you have access credentials for or is on your LAN.
Ask your company system admin for the SMTP server name of the company you work for. Use this as the smtp server host. You can still use your gmail address as you, but the email will be sent from your local smtp server. This is the way all mail clients work on desktops, ie Thunderbird or MS Outlook. You can verify a quick connection to the smtp server by using the telnet program, followed by quit > Telnet smtp.mycompany.com 25 You should get a connection message. like: 220 mwinf2029.mycompany.com ESMTP ABO ************************** quit 221 2.0.0 Bye Connection to host lost. Now you should be ready to test the sending of an email using your Application. The reason you cannot connect to gmail would be for security reasons. Cheers, - Chuck On May 11, 7:11 pm, abhiram wuntakal <abhir...@gmail.com> wrote: > Hi Salvador, > > Thanks a lot for that quick response. Well, i am not much familiar with the > protocols. > > I used the smtp.gmail.com instead of the ip string. Now i am getting stuck > at an other place and I am getting an error like "gwt > com.sun.mail.smtp.smtpsendfailedexception: 530 must issue a STARTTLS command > first." > > Please suggest if u know a way out of this issue. > > Thanks, > Abhiram > > On Mon, May 11, 2009 at 6:09 PM, Salvador Diaz <diaz.salva...@gmail.com>wrote: > > > > > > > I think you need to learn a bit more about how email works before > > trying to do that. > > For the record, gmail.com is an http server not a smtp one. > > If you don't want to bother learning about email protocols, I suggest > > you try smtp.gmail.com instead of 209.85.171.83 > > > Cheers, > > > Salvador > > > On May 11, 2:06 pm, abhiram <abhir...@gmail.com> wrote: > > > Hi all, > > > > I am writing an application to send an email from the server side. I > > > am using the mail.jar for this purpose. I have written a function for > > > this as below: > > > > protected void sendMessage(String smtpHost, String fromAddress, String > > > fromName, String to, String subject, String text) throws > > > UnsupportedEncodingException, MessagingException > > > { > > > System.out.println("ABC"); > > > // Get system properties > > > Properties props = System.getProperties(); > > > // Setup mail server > > > props.put("mail.smtp.host", smtpHost); > > > // Get session > > > javax.mail.Session session = > > javax.mail.Session.getDefaultInstance > > > (props, null); > > > // Define message > > > MimeMessage message = new MimeMessage(session); > > > // Set the from address > > > message.setFrom(new InternetAddress(fromAddress, fromName)); > > > // Set the to address > > > message.addRecipient(Message.RecipientType.TO, new > > InternetAddress > > > (to)); > > > // Set the subject > > > message.setSubject(subject); > > > // Set the content > > > message.setContent(text, "text/html"); > > > // Send message > > > Transport.send(message); > > > } > > > > and i am invoking the function using this line of code. > > > > sendMessage("209.85.171.83", "abhir...@gmail.com", "abhiram", > > > "abhir...@gmail.com", "Hi", "Message-Body"); > > > > Here, i found the ip address is of gmail.com which i got by pinging > > > for gmail.com. Please let me know if this approach is right as I am > > > getting an error like "Could not connect to SMTP host : 66.249.93.109, > > > port:25 ". > > > > Thanks and Regards, > > > Abhiram- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---