Re: Unable to send email from local server



mighty.tornado@xxxxxxxxx wrote in news:1177379020.756857.185980
@l77g2000hsb.googlegroups.com:

Hi,

I set up a small web app and would like to send email, so I am using
google's smtp server. But I get an exception back. Here it is:

[snippage]

Caused by: javax.mail.MessagingException: Could not connect to SMTP
host: smtp.g
mail.com, port: 465, response: -1
at
com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1270)
at
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:37
0)
at javax.mail.Service.connect(Service.java:297)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:
863)
... 19 more

What am I doing wrong?

The mail client software (your app) was unable to connect to the mail server
"smtp.gmail.com" on port 465, as the exception message stated. This could be
for any number of reasons, including:

- you have a firewall blocking your host from connecting to a remote host on
port 465.

- gmail's mail server is down and temporarily unreachable

- a router somewhere between your host and smtp.gmail.com is malfunctioning
and preventing a connection

- you aren't using SSL/TLS in your connection to smtp.gmail.com, as is
required, per <http://mail.google.com/support/bin/answer.py?answer=13287
&topic=1556>.

using telnet to connect to the remote host will allow you to determine if the
problem lies within your code (i.e. telnet is able to connect) or outside of
your code (i.e. telnet is also unable to connect). If the problem can be
localized to your code, then JavaMail has a debugging trace option that is
enabled by setting a system property named "mail.debug" to "true" (String
value). This will cause a full transcript of your session with the mail
server to be output to the console, and is quite useful in diagnosing issues
such as this.


In any case, this is something that your code should anticipate and handle
gracefully - your code is dependent upon a resource (the mail server) that is
outside of your control, therefore your code MUST handle this resource being
unavailable, either permanently or temporarily, gracefully.

Cheers!

--
---------------------------------------------------------------------
Greg R. Broderick usenet200704@xxxxxxxxxxxxxxxxxxxxx

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
.



Relevant Pages

  • RE: No delivery report 4.4.7
    ... mail.rabarberlandet.dk is a mail server host on our ISP. ... Please let me know where the mail.rabarberlandet.dk host on. ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: IIS hosting remote object
    ... Host a Remote Object in Microsoft Internet Information Services ... IClock ... > catch (Exception e) ... I replaced my actual web server name with "WebServer" in the url. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: samba backup through firewall
    ... > This sounds as if you are running the mail server on some windoze platform ... ALL connections to the DMZ should be from ... > host, they are limited in what they can do. ... > relays it to an internal mail server where distribution actually occurs. ...
    (alt.computer.security)
  • Re: Web site viewable from outside office but not on Lan
    ... I notice from the server ipconfig /all that the public address on this ... Other than the problem noted below with the mail server, ... and host header and IP addresses are properly configured in IIS. ... > There is a Forward Lookup Zone for ourcompany.com and it has a host ...
    (microsoft.public.windows.server.dns)
  • gdm hangs
    ... gdm will hang 9 of 10 times when logging out. ... with or without the client having been connected to the Server. ... # Timed login, useful for kiosks. ... Must output the chosen host on stdout, ...
    (Debian-User)