Solved

Problem with xp_smtp_sendmail and attachments

Posted on 2008-06-16
3
1,634 Views
Last Modified: 2008-06-17
I have been successful for quite a qhile using xp_smtp_sendmail to generate emails in SQL Server 2005.  Now I have tried to add an attachment to the email, and the sproc fails with this error:
Error: dumping message content to @dumpmsg DumpMsgFileLocation failed


Can anyone give me example code for xp_smtp_sendmail  with attachments that works?
0
Comment
Question by:wsturdev
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
dready earned 500 total points
ID: 21798877
You probably know this, but it should look like this:
I've been sending attachments without any problems; unfortunately i don't know what that error message means. Is the path to the attachment a path on the server? And not on the machine from which you execute the query/stored proc?

declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
    @FROM       = N'MyEmail@MyDomain.com',
    @FROM_NAME  = N'Joe Mailman',
    @TO         = N'MyFriend@HisDomain.com',
    @CC         = N'MyOtherFriend@HisDomain.com',

    @BCC        = N'MyEmail@MyDomain.com',

    @priority   = N'HIGH',
    @subject    = N'Hello SQL Server SMTP Mail',
    @message    = N'Goodbye MAPI, goodbye Outlook',
    @type       = N'text/plain',
    @attachments= N'c:\attachment1.txt;c:\attachment2.txt',
    @server     = N'mail.mydomain.com'
select RC = @rc

go

0
 
LVL 1

Author Comment

by:wsturdev
ID: 21802110
What you are doing is exactly what I am doing.  The attachment is on the server.

What settings do you have on your server?  I suspect a server setting might be affecting me.
0
 
LVL 1

Author Comment

by:wsturdev
ID: 21802280
I went to the server, to AQL Server 2005 Surface Area Configuration and turned OFF SQL Mail.  That let the process work.  You led me to investigate that, so I am giving you the points.

But, maybe, since you have experience with attachments, you can answer a question...  I know I can place any kind of document on the server and use it as an attachment.  But how do I get it there?

I posted another question maybe you can look at:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_23489806.html
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now