Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
IIbIXAPb  
#1 Posted : Monday, May 6, 2019 8:07:10 PM(UTC)
IIbIXAPb

Rank: Newbie

Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 2
Russian Federation
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
ivan  
#2 Posted : Monday, May 6, 2019 9:57:54 PM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,153

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
thanks 1 user thanked ivan for this useful post.
IIbIXAPb on 5/6/2019(UTC)
IIbIXAPb  
#3 Posted : Monday, May 6, 2019 11:06:37 PM(UTC)
IIbIXAPb

Rank: Newbie

Groups: Registered
Joined: 6/8/2017(UTC)
Posts: 2
Russian Federation
Location: Norilsk

Thanks: 2 times
Originally Posted by: ivan Go to Quoted Post
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?
ivan  
#4 Posted : Tuesday, May 7, 2019 4:04:20 AM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,153

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
thanks 1 user thanked ivan for this useful post.
IIbIXAPb on 5/7/2019(UTC)
Users browsing this topic
Guest
Forum Jump  
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.054 seconds.

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.