| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-06-29 : 08:06:46
|
| Tammy writes "Windows 2000 Service Pack 4SQL Server Standard Edition Version 8i've attached the stored procedureand an example of its usemy problem is that the resulting email only contains a portion of whatever URL i put in the email....sometimes only the http: shows up sometimes http://www.abc.ca/fowhy doesn't the url show up in the body of the email???thankstammyexec sp_SendMailAttachments 'me@abc.ca','me@abc.ca','Request for Data','Please find instructions and information regarding the completion and submission of your data. Use the following link to access the online forms: http://www.abc.ca/forms','c:\temp\instructions.txt','c:\temp\information.txt'CREATE procedure sp_SendMailAttachments @To varchar(255), @From varchar(255), @Subject varchar(255), @Body varchar(255), @Attach1 varchar(255), @Attach2 varchar(255) ASDECLARE @Mail intDECLARE @hr intDECLARE @src varchar(255), @desc varchar(255)EXEC @hr = sp_OACreate 'Persits.MailSender', @Mail OUTIF @hr <> 0BEGIN EXEC sp_OAGetErrorInfo @Mail, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc RETURNENDEXEC @hr = sp_OASetProperty @Mail, 'Host', '130.15.52.20'EXEC @hr = sp_OASetProperty @Mail, 'From', @FromEXEC @hr = sp_OASetProperty @Mail, 'Subject', @SubjectEXEC @hr = sp_OASetProperty @Mail, 'Body', @BodyEXEC @hr = sp_OAMethod @Mail, 'AddAddress', NULL, @ToEXEC @hr = sp_OAMethod @Mail, 'AddAttachment', NULL, @Attach1EXEC @hr = sp_OAMethod @Mail, 'AddAttachment', NULL, @Attach2EXEC @hr = sp_OAMethod @Mail, 'Send'IF @hr <> 0BEGIN EXEC sp_OAGetErrorInfo @Mail, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc RETURNENDGO" |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-06-29 : 22:18:00
|
| have you checked the parameter length? the text is probably being truncated--------------------keeping it simple... |
 |
|
|
stoneroses
Starting Member
2 Posts |
Posted - 2006-05-23 : 02:31:38
|
| I encountered the following error.Email gets sent but sql returns this error though.Msg 0, Level 11, State 0, Line 0A severe error occurred on the current command. The results, if any, should be discarded. |
 |
|
|
|
|
|