Re: [Solved]ERJavaMail: trying sending through Google Mail
Daniele Corti <[email protected]> Wed, 24 Apr 2013 17:24:10 +0200
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <CAJh8f2_6yXoyV-7tRyFSpPujLW4dt8eCmT+R4QR6qwaLY-2KhA@mail.gmail.com> |
Hi,
I'm answering to my own post... I've made some test and the problem seems
localized to the version of the ERJavaMail framework that I've used in the
app.
In fact, tring to send email with the lastest (at least one of the lastest)
version of Wonder the mail is sended without problems.
Seems time to update the Wonder Frameworks...
Here the ERJavaMail Properties that works with Google Apps:
# ERJavaMail
er.javamail.centralize=true
er.javamail.adminEmail=daniele@{ourdomain.com}
er.javamail.debugEnabled=true
*er.javamail.smtpProtocol=smtps*
er.javamail.smtpHost=smtp.gmail.com
er.javamail.smtpAuth=true
[email protected]
er.javamail.smtpPassword=*********
The Code for sending email is:
ERMailDeliveryPlainText mail = new ERMailDeliveryPlainText();
mail.setTextContent("This is a Test!");
try {
mail.newMail();
// Here is really important to use the same email used
// in smtpUser property or
// an email from which the user is allowed to send
mail.setFromAddress("[email protected]");
mail.setReplyToAddress("[email protected]");
mail.setSubject("TEST");
mail.setToAddresses(new NSArray<String>("daniele@{outdomain.com}"));
mail.sendMail();
} catch (Exception e) {
}
Bye!
D.
---------- Forwarded message ----------
From: Daniele Corti <[email protected]>
Date: 2013/4/24
Subject: ERJavaMail: trying sending through Google Mail
To: wonder Project <[email protected]>
Hi,
I'm trying to send email through the Google Mail system, but I've some
problems.
When I try to send through SMTP, the server answer to establish a TLS
secure connection first.
530 5.7.0 Must issue a STARTTLS command first. j44sm4299850eeu.10 - gsmtp
Even if I change the Port to 587 (er.javamail.smtpPort=587) the error is
the same. (with the port 465 the communication stop after the socket is
opened)
Reading:
http://prod.lists.apple.com/archives/webobjects-dev/2013/Mar/msg00066.html
I've notice that to use Gmail I need to set a secure Transport Protocol:
smpts.
the problem is that, when I set er.javamail.smtpProtocol=smtps
the operation fail with this error:
- ERROR er.javamail.ERMailSender - General mail error:
javax.mail.NoSuchProviderException: smtps
Am I missing some library in order to use smtps?
I've tried also to add the property: mail.smtp.starttls.enable=true
But the communication with smtp does not change, it continues to ask for a
STARTTLS command.
Thanks in advance!
D.
--
Daniele Corti
--
I DON'T DoubleClick
--
Daniele Corti
--
I DON'T DoubleClick
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Wonder-disc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wonder-disc