Sapna20
5th June 2013, 12:46
Hi Experts,
I am sending email via SMTP when the Purchase Order get approved.
I want to send the Purchase Order print in the Email Body.
I am able to send as attachment bt its not working fine when I am sending in Body.
Please help me in this context.
bhushanchanda
5th June 2013, 13:40
Hi Sapna,
How are you doing it? Please post your code or any snapshots of the issue.
Sapna20
5th June 2013, 14:24
Hi Bhushan Sir,
Here is my code for the attachment.....
ret = client2server(" ", bse.tmp.dir$() & "/file.name.txt",false, false, false)
abc = bse.tmp.dir$()
file.name = strip$(abc) &"/file.name.txt"
attachment.id = cmf.createAttachment(
message.id)
return.value = cmf.setAttachmentBody(
attachment.id,
ttyeno.yes)
return.value = cmf.setAttachmentMIME(
attachment.id,
"text/plain")
return.value = cmf.setAttachmentFileName(
attachment.id,
file.name)
Here, I am uploading a text file from my desktop to server and I create the text file with table format through encoding.
But when I am sending the mail through attachment its cming fine but not in email body.
May be there is an issue of encoding.
How can i encode the file.
JaapJD
5th June 2013, 17:30
I think it is the order of the calls. Try cmf.setAttachmentBody as the last one.
bhushanchanda
6th June 2013, 07:03
I am not sure whether it will work or not, but give it a try:-
Try changing :-
return.value = cmf.setAttachmentBody(
attachment.id,
ttyeno.yes)
to
return.value = cmf.setAttachmentBody(
attachment.id,
"TRUE")
Sapna20
6th June 2013, 11:39
Hi Bhushan,
I tried as u said but this still is not working.
If u get an alternative then let me know.
Thanks...
NPRao
7th June 2013, 22:47
Sapna,
You have to post your complete code for others to help you out than making guess what you did wrong.
Here is a snippet from my program -
attach.id = cmf.createAttachment(cmf.MessageObject)
e = cmf.setAttachmentBody(attach.id, attach.yn)
e = cmf.setAttachmentMIME(attach.id, check.plugin(filename))
if isspace(displayname) then
attach.fname = fname.from.path(filename)
else
attach.fname = displayname
endif
e = cmf.setAttachmentFileName(attach.id, filename, attach.fname)