SMTP Server configuration in apigee

Not applicable

Hi,

I want to send email to gmail account with some details through api proxy in apigee. I want to use that smtp server in java callout policy. Please let me know if Apigee provides any smtp server configuration in-built. As i am not sure why smtp.gmail.com is not accessible. it gives below error

java.security.AccessControlException: access denied ("java.net.SocketPermission" "smtp.gmail.com" "resolve") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.security.AccessController.checkPermission(AccessController.java:884) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at com.apigee.securitypolicy.InternalSecurityManager.checkPermission(InternalSecurityManager.java:79) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1048) at java.net.InetAddress.getAllByName0(InetAddress.java:1268) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at java.net.InetAddress.getByName(InetAddress.java:1076) at javax.mail.URLName.getHostAddress(URLName.java:486) at javax.mail.URLName.hashCode(URLName.java:462) at java.util.Hashtable.get(Hashtable.java:363) at javax.mail.Session.getPasswordAuthentication(Session.java:827) at javax.mail.Service.connect(Service.java:278) at javax.mail.Service.connect(Service.java:176) at javax.mail.Service.connect(Service.java:125) at javax.mail.Transport.send0(Transport.java:194) at javax.mail.Transport.send(Transport.java:124) at

please help me out.

0 1 837
1 REPLY 1

Please let me know if Apigee provides any smtp server configuration in-built.

No, The Apigee Edge service does not include SMTP service.

As for why you cannot open a socket to smtp.gmail.com , I believe the security checks on Java callouts have recently been changed to be more restrictive so that you cannot make arbitrary outbound socket connection from within custom Java code.

You can make HTTP outbound calls with ServiceCallout, and if you use mailchimp or AWS SES, you can hit those services from an Apigee Edge API Proxy.