Google Apps Engine, Sending out Emails Receiving this Error (Attempt to access a blocked recipient without permission.) Java -


i've figured out how receive emails via google engine. i'm trying send out confirmation email received, keep getting error:

com.jkimgroup.emailtospreadsheet.mailhandlerservlet dopost:   messagingexception: javax.mail.sendfailedexception:    send failure (javax.mail.messagingexception:    not connect smtp host: localhost, port: 25 (java.net.socketexception: permission denied:   attempt access blocked recipient without permission.)) 

i have "from" address set admin email. error message perhaps i'm not including correct jar files in /web-inf/lib folder?

and used google's standard example: https://developers.google.com/appengine/docs/java/mail/usingjavamail

import java.util.properties;  import javax.mail.message; import javax.mail.messagingexception; import javax.mail.session; import javax.mail.transport; import javax.mail.internet.addressexception; import javax.mail.internet.internetaddress; import javax.mail.internet.mimemessage;      // ...     properties props = new properties();     session session = session.getdefaultinstance(props, null);      string msgbody = "...";      try {         message msg = new mimemessage(session);         msg.setfrom(new internetaddress("admin@example.com", "example.com admin"));         msg.addrecipient(message.recipienttype.to,                          new internetaddress("user@example.com", "mr. user"));         msg.setsubject("your example.com account has been activated");         msg.settext(msgbody);         transport.send(msg);      } catch (addressexception e) {         // ...     } catch (messagingexception e) {         // ...     } 

update i'm starting think perhaps i'm suppossed use appengine librares instead mail processing though official documentation pointing toward using javamail 1.4.7?

in case that's case, here libraries i've imported in code.

import java.io.ioexception; import java.net.malformedurlexception; import java.net.url; import java.sql.timestamp; import java.text.dateformat; import java.text.simpledateformat; import java.util.properties; import java.util.timezone; import java.util.logging.logger;  import javax.mail.address; import javax.mail.message; import javax.mail.messagingexception; import javax.mail.multipart; import javax.mail.part; import javax.mail.session; import javax.mail.transport; import javax.mail.internet.addressexception; import javax.mail.internet.internetaddress; import javax.mail.internet.mimemessage; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse;  //am supossed import 1 instead of javax.mail.* jars? //import com.google.appengine.api.mail.mailservice.message; import com.google.appengine.api.users.user; import com.google.gdata.client.spreadsheet.spreadsheetservice; import com.google.gdata.data.spreadsheet.listentry; import com.google.gdata.util.authenticationexception; import com.google.gdata.util.serviceexception; 

update 2 fixed now added in oracle's javamail jars app did cause problems according to:

all of javamail classes need included app engine sdk. not add oracle®'s javamail jars app; if do, app throw exceptions.

https://developers.google.com/appengine/docs/java/mail/?csw=1

this not definitive answer ...

the exception message says this:

could not connect smtp host: localhost, port: 25          (java.net.socketexception: permission denied:          attempt access blocked recipient without permission.)) 

so transport attempting use smtp service running on same machine gae. error message seems indicate succeeding in connecting, , smtp service refused accept email delivery of recipients.

so suggest following:

  • try out real email addresses not "xxx@example.com" addresses.
  • check configurations local mta service (whatever is) see if configured relay email external addresses.
  • check mta log files. there should record of email rejection.

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -