Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 proeblem with sp_send_dbmail

Author  Topic 

DaveC11
Starting Member

43 Posts

Posted - 2009-03-19 : 10:56:11
Is there way using sp_send_dbmail to attach a image document (word doc stored in my sql db) to the email that's is being sent.

eg

declare @doc (not sure what data type i'd need)
set @doc = (select document from documents where userid = logged in user id

exec msdb.dbo.sp_send_dbmail
@profile_name='email',
@recipients= @loggedinusersemail ,
@subject= "Job application",
@body = whatever
@file_attachments =@doc

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-19 : 11:15:09
if its image use varbinary(max)
Go to Top of Page

DaveC11
Starting Member

43 Posts

Posted - 2009-03-19 : 11:27:44
where???
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-19 : 11:47:23
declare @doc varbinary(max)
....
Go to Top of Page
   

- Advertisement -