dbTalk Databases Forums  

Using xp_sendmail To Attach File To E-Mail NOT Place In Body Of E-Mail

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Using xp_sendmail To Attach File To E-Mail NOT Place In Body Of E-Mail in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Anthony Mangione
 
Posts: n/a

Default Using xp_sendmail To Attach File To E-Mail NOT Place In Body Of E-Mail - 10-27-2010 , 05:39 PM






To Whom It May Concern:

I REALLY, REALLY, REALLY hope someone can help me with this... It'll
help immensely.

I'm running on SQLAnywhere 11.0.1. I have a SQL script that calls a
stored procedure that contains a CALL to xp_sendmail that sends
colleagues an e-mail every time a we run a process for one of our
clients. I'm DYING to get this call to actually attach a Word DOC
file to the e-mail itself INSTEAD of placing it in the body of the e-
mail.

For example, here's a snapshot of what's at the bottom of the body of
the e-mail that's getting sent:

--==_EMAIL_MIME_2010_1027_175038_==
Content-Type: application/octet-stream; name="ye_load_approval.doc"
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="ye_load_approval.doc"

0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/
CQAGAAAAAAAAAAAAAAABAAAASAAAAAAAAAAA
EAAASgAAAAEAAAD+////
AAAAAEcAAAD/////////////////////////////////////////////
....
....
....

Here's what my call to xp_sendmail looks like, very simple:

CALL xp_sendmail(include_file='D:\\ye_load_approval.doc ',
recipient=to_list,
subject=subjectdata,
"message"=bodydata);

Mind you, to_list, subjectdata and bodydata are variables in my stored
procedure so the contents of the e-mail can be dynamic, so no worries
there.

I am also using xp_startsmtp and xp_stopsmtp.

Now, I see that the documentation states:

"Attachments specified by the include_file parameter are sent as
application/octet-stream MIME type, with base64 encoding, and must be
present on the database server."

Is there anyway I can get this to not appear in the e-mail body and
get it to be a true attachment?

I see there's lots of other options in xp_sendmail (i.e., attachname,
attach_result, etc...) via Transact-SQL, which I don't know much about
nor do I know if I can take advantage of them?

Any help would be appreciated. Thanks!

Sincerely,
Anthony Mangione
amangione (AT) jatsoftware (DOT) com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.