![](https://community.sap.com/html/assets/img_tile-default.png)
smtp.gmail.com
server) because they require TLS connections. This limitation had been mentioned before by users trying to set up the SQL Anywhere Monitor to use GMail accounts for sending alert messages.xp_startsmtp
function has been enhanced to accept a certificate file that is used to authenticate a remote SMTP server. The remainder of this post will be a tutorial on setting up SQL Anywhere to send email through GMail's SMTP server.smtp.gmail.com
, and TLS connections are made on port 587
. In order to connect, we will need to supply xp_startsmtp
with the path to the root certificate that Google is using as their certifying authority. Most mail application include the root CA certificates of the major certifying authorities such as Verisign, Equifax, etc. However, since SQL Anywhere is not a mail reader, it does not come bundled with these root certificates. How can we determine what certifying authority GMail is using, and where do we get the root certificate?smtp.gmail.com
with openssl using:openssl s_client -starttls smtp -connect smtp.gmail.com:587
---
Certificate chain
0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
i:/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com
---
smtp.gmail.com
certificate is signed by the Thawte Premium Server CA
certificate issued by Thawte Consulting. There are two ways we can obtain a copy of this root certificate.Thawte Premium Server CA
certificate out of IE 8.0 you can go Tools –> Internet Options –> Content –> Certificates –> Trusted Root Certificates. Find “Thawte Premium Server CA” in the list, and hit the “Export” button. In the Export wizard, choose “Base-64 (.CER) format”. Other browsers such as FireFox and Chrome allow you to export certificates in a similar way.SELECT xp_startsmtp(<your gmail address>,
'smtp.gmail.com', 587, 60,
<your display name>,
<your gmail address>,
<your gmail password>,
<root certificate path>);
-- Ex. SELECT xp_startsmtp('john.doe@gmail.com', 'smtp.gmail.com', 587, 60, 'John Doe', 'john.doe@gmail.com', 'itsasecret', 'C:\certs\ThawtePremiumServerCA.crt');
xp_sendmail
to send emails.SELECT xp_sendmail('john.doe@gmail.com', 'Hello, SMTP Server');
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 |