Rank: Newbie
Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 2
Location: Norilsk
Thanks: 2 times
Good day. Tested in trial mode your components. Everything's OK. Question: how can I send a letter with a file using MS SQL server? Is there such a possibility? thank
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
You can also add an attachment like this
Code:
EXEC @hr = sp_OAMethod @oSmtp, 'AddAttachment', @result OUT, 'd:\test.jpg'
If @result <> 0
BEGIN
EXEC @hr = sp_OAMethod @oSmtp, 'GetLastErrDescription', @description OUT
PRINT 'failed to add attachment with the following error:'
PRINT @description
RETURN
END
1 user thanked ivan for this useful post.
Rank: Newbie
Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 2
Location: Norilsk
Thanks: 2 times
Originally Posted by: ivan You can also add an attachment like this
Code:
EXEC @hr = sp_OAMethod @oSmtp, 'AddAttachment', @result OUT, 'd:\test.jpg'
If @result <> 0
BEGIN
EXEC @hr = sp_OAMethod @oSmtp, 'GetLastErrDescription', @description OUT
PRINT 'failed to add attachment with the following error:'
PRINT @description
RETURN
END
Thank. Can I attach multiple files this way?
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,154
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
Yes, you can do it like this:
Code:
EXEC @hr = sp_OAMethod @oSmtp, 'AddAttachment', @result OUT, 'd:\test1.jpg'
If @result <> 0
BEGIN
EXEC @hr = sp_OAMethod @oSmtp, 'GetLastErrDescription', @description OUT
PRINT 'failed to add attachment with the following error:'
PRINT @description
RETURN
END
EXEC @hr = sp_OAMethod @oSmtp, 'AddAttachment', @result OUT, 'd:\test2.jpg'
If @result <> 0
BEGIN
EXEC @hr = sp_OAMethod @oSmtp, 'GetLastErrDescription', @description OUT
PRINT 'failed to add attachment with the following error:'
PRINT @description
RETURN
END
EXEC @hr = sp_OAMethod @oSmtp, 'AddAttachment', @result OUT, 'd:\test3.jpg'
If @result <> 0
BEGIN
EXEC @hr = sp_OAMethod @oSmtp, 'GetLastErrDescription', @description OUT
PRINT 'failed to add attachment with the following error:'
PRINT @description
RETURN
END
1 user thanked ivan for this useful post.
Forum Jump
EmailArchitect Support
Email Component Development
- EASendMail SMTP Component - .NET Version
- EASendMail SMTP Component - Windows Store Apps
- EASendMail SMTP ActiveX Object
- EAGetMail POP3 & IMAP4 Component - .NET Version
- EAGetMail POP3 & IMAP4 ActiveX Object
Exchange Server and IIS SMTP Plugin
- DomanKeys/DKIM for Exchange Server and IIS SMTP
- Disclaimer and S/MIME for Exchange Server and IIS
EmailArchitect Email Server
- EmailArchitect Email Server (General)
- EmailArchitect Email Server Development
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.