Solved

Problem with xp_smtp_sendmail and attachments

Posted on 2008-06-16
3
1,644 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Pivot Rows To Columns 10 54
SQL Query including math and 2 tables problem 26 51
TSQL query to generate xml 4 35
SQL Query assistance 16 26
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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