I'm not having any luck following Eric Farrar's instructions for using xp_startsmtp with gmail.

Return code 105 means "A TLS error occurred" ( like I didn't know that already :)...

I'm using Norton Internet Security, tried turning it off but no joy.

xp_startsmtp @return_code = 105
xp_sendmail @return_code = 25
BEGIN
DECLARE @return_code           INTEGER;
DECLARE @smtp_sender           LONG VARCHAR;
DECLARE @smtp_server           LONG VARCHAR; 
DECLARE @smtp_port             INTEGER; 
DECLARE @timeout               INTEGER;
DECLARE @smtp_sender_name      LONG VARCHAR;
DECLARE @smtp_auth_username    LONG VARCHAR; 
DECLARE @smtp_auth_password    LONG VARCHAR;
DECLARE @trusted_certificates  LONG VARCHAR;
DECLARE @recipient             LONG VARCHAR;
DECLARE @subject               LONG VARCHAR;
DECLARE @message               LONG VARCHAR;

SET @smtp_sender          = 'Breck.Carter@gmail.com'; -- full email address for gmail
SET @smtp_server          = 'smtp.gmail.com';  -- smtp.gmail.com for gmail
SET @smtp_port            = 587;  -- 25 for standard SMTP, 465 or 587 for gmail
SET @timeout              = 10;   -- default is 60 seconds
SET @smtp_sender_name     = 'Foxhound';
SET @smtp_auth_username   = 'Breck.Carter@gmail.com'; -- full email address for gmail
SET @smtp_auth_password   = '...';
SET @trusted_certificates = 'C:\TEMP\Thawte Premium Server CA.cer';
SET @recipient            = 'bcarter@bcarter.com';
SET @subject              = STRING ( 'test subject at ', CURRENT TIMESTAMP );
SET @message              = STRING ( 'test message at ', CURRENT TIMESTAMP );

@return_code = CALL xp_startsmtp ( 
   smtp_sender          = @smtp_sender,  
   smtp_server          = @smtp_server,  
   smtp_port            = @smtp_port,  
   timeout              = @timeout,
   smtp_sender_name     = @smtp_sender_name,
   smtp_auth_username   = @smtp_auth_username, 
   smtp_auth_password   = @smtp_auth_password,
   trusted_certificates = @trusted_certificates );

MESSAGE STRING ( 'xp_startsmtp @return_code = ', @return_code ) TO CLIENT;

@return_code = CALL xp_sendmail ( 
   recipient  = @recipient,  
   subject    = @subject,  
   "message"  = @message );

MESSAGE STRING ( 'xp_sendmail @return_code = ', @return_code ) TO CLIENT;

CALL xp_stopsmtp(); -- do not bother to check return code

EXCEPTION WHEN OTHERS THEN
   CALL xp_stopsmtp();

END;

asked 29 Mar '11, 16:40

Breck%20Carter's gravatar image

Breck Carter
27.0k424582830
accept rate: 21%

edited 29 Mar '11, 16:47


Google recently (not sure when exactly) changed the certificate that is used by their gmail service. They now use a certificate from Equifax.

You should likely download the certificate directly from Equifax (or Google) but I have attached one that works (as of this date of this posting) to get you going.

I guess Eric should update his blog entry? (I'll mention this to him)

permanent link

answered 29 Mar '11, 17:29

Mark%20Culp's gravatar image

Mark Culp
22.6k9129265
accept rate: 40%

edited 29 Mar '11, 17:30

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×101

question asked: 29 Mar '11, 16:40

question was seen: 2,148 times

last updated: 29 Mar '11, 17:30