dantheinfoman
Programmer
Hi All,
My email system has an activex button that does the work of sending emails when needed. I need to send an image with certain emails. I've been successful in adding the image as an attachment, but I'm not sure how to EMBED the image so it's in the actual body of the email. Here's how the email works currently with an attachment:
I've seen some talk about utilizing HTML in emails in order to embed an image, but nothing's clear as to how I can accomplish this. My app doesn't need login credentials or 'smpt server' names or anything like that, it just sends a bunch of emails at a time as needed using Thunderbird automatically.
Anyone know what I can do to embed these?
Thanks
Dan
My email system has an activex button that does the work of sending emails when needed. I need to send an image with certain emails. I've been successful in adding the image as an attachment, but I'm not sure how to EMBED the image so it's in the actual body of the email. Here's how the email works currently with an attachment:
Code:
local j, lnMaxLength, i, lcMessageText, lvFieldValue
** j & i are counters
private array paDBFields
*** Localizable Strings
#DEFINE DBF_NOT_FOUND_LOC "No table is open in the current work area."
#DEFINE GEN_UNSUPPORT_LOC "General fields are not supported in this example and will be skipped."
#DEFINE _FALSE_LOC "FALSE"
#DEFINE _TRUE_LOC "TRUE"
#DEFINE _NULL_LOC "NULL"
#DEFINE _DOLLARSIGN_LOC "$"
#DEFINE FLD_NO_PRINT_LOC "Field could not be printed."
#DEFINE RECORDNUM_LOC "Record #"
?"Checking Email"
* Verify that a table is open in the current work area
if empty(dbf())
=messagebox(DBF_NOT_FOUND_LOC,48)
return
else
IF !this.parent.signon() && Use the custom method
RETURN
ENDIF
IF this.parent.LogSession && Check if the user was able to login
this.parent.OleMMess.sessionid=this.parent.OleMSess.sessionid
* Get the number of fields in the current table
=afields(paDBFields)
**** find the longest field string for approximate formatting purposes
lnMaxLength = 0
for j = 1 to alen(paDBFields,1)
if len(paDBFields(j,1))+2 > lnMaxLength
lnMaxLength = len(paDBFields(j,1))+2
endif
endfor
* Start a new mail message and build the text
this.parent.OleMMess.compose
lcMessageText=""
for i = 1 to alen(paDBFields,1)
lvFieldValue=alltrim(upper(paDBFields(i,1)))
lcMessageText=lcMessageText+this.parent.addtabs((lvFieldValue+": "),lnMaxLength)
if !isnull(&lvFieldValue)
lcMessageText = m.subject
else
lcMessageText=lcMessageText+_NULL_LOC
endif
endfor
IF EMPTY(m.vheader)
this.parent.OleMMess.msgnotetext=lcMessageText
this.parent.OleMMess.msgsubject=m.subject
ELSE
this.parent.OleMMess.msgsubject=m.vheader
this.parent.OleMMess.msgnotetext=m.subject
ENDIF
****ds 10/13/16 test
IF !EMPTY(m.m_attfname)
lnpos = 0 &&len(m_message) + 5
this.parent.OleMMess.AttachmentIndex = 0
this.parent.OleMMess.Attachmentposition = lnpos
this.parent.OleMMess.AttachmentName = JUSTFNAME(M_ATTFNAME)
this.parent.OleMMess.AttachmentPathname = alltrim(m_attfname)
endif
****
*this.parent.OleMMess.msgsubject=m.subject
this.parent.OleMMess.recipaddress=m.address
this.parent.OleMMess.send
IF this.parent.logsession
this.parent.OleMSess.signoff
ENDIF && Session Handle test
ENDIF && Login Test
endif && DBF Test
I've seen some talk about utilizing HTML in emails in order to embed an image, but nothing's clear as to how I can accomplish this. My app doesn't need login credentials or 'smpt server' names or anything like that, it just sends a bunch of emails at a time as needed using Thunderbird automatically.
Anyone know what I can do to embed these?
Thanks
Dan