Hi,
I'm sending emails out thru VFP9 using CDO's. Everything works perfectly except that as of Feb-2024, Google insists that every email sent to Gmail users must have a DKIM signature.
How do I add the DKIM signature to this code please.
accno='000-000000'
has_txt=.F.
has_pdf=.F.
m.emal='mine@gmail.com'
LOCAL iMsg,iConf
DECLARE SHORT InternetGetConnectedState IN wininet.DLL;
INTEGER @lpdwFlags, INTEGER dwReserved
lConnect=displayState()
IF lConnect
iMsg = CREATEOBJECT("CDO.Message")
iConf = CREATEOBJECT("CDO.Configuration")
Flds = iConf.FIELDS
WITH Flds
.ITEM(" = 2
.ITEM(" = 'ourserver' && ourserver
.ITEM(" = 25
.UPDATE()
ENDWITH
WITH iMsg
.Configuration = iConf
.TO = m.emal
.BCC = ""
.FROM = "me@example.ca"
.Subject = "Your Invoice is Now Ready 2024-01"
.FIELDS("Priority").VALUE = 0 && -1=Low, 0=Normal, 1=High
.Fields(" = 1
.Fields(" = 60
.Fields(" = .T.
.FIELDS.UPDATE()
IF has_txt=.F. && HAS ONLY PDF (NO TXT FILE EXISTS)
bod="<img src='cid:logo.png'><BR>Hello,<BR><BR>in PDF.<BR>"
.HtmlBody=bod
ELSE && EXISTS BOTH THE PDF & TXT FILE SO EMAIL BODY IS A LITTLE DIFFERENT
bod="<img src='cid:logo.png'><BR>Hello,<BR><BR>your pdf PDF.<BR>"
.HtmlBody=bod
ENDIF
.AddAttachment ("C:\Users\jk\Desktop\ff\logo.png") && ALWAYS DONE SO THAT EVERYBODY HAS THE LOGO
.SEND()
ENDWITH
iMsg = .NULL.
iConf = .NULL.
Flds = .NULL.
ELSE
MESSAGEBOX("Could not send the message, your internet connection is down.")
ENDIF
PROCEDURE displayState
LOCAL lConnected
lConnected = .F.
lpdwFlags = 0
IF InternetGetConnectedState (@lpdwFlags, 0) = 1
lConnected = .T.
ENDIF
RETURN lConnected
ENDPROC
Thanks,
FOXUP
I'm sending emails out thru VFP9 using CDO's. Everything works perfectly except that as of Feb-2024, Google insists that every email sent to Gmail users must have a DKIM signature.
How do I add the DKIM signature to this code please.
accno='000-000000'
has_txt=.F.
has_pdf=.F.
m.emal='mine@gmail.com'
LOCAL iMsg,iConf
DECLARE SHORT InternetGetConnectedState IN wininet.DLL;
INTEGER @lpdwFlags, INTEGER dwReserved
lConnect=displayState()
IF lConnect
iMsg = CREATEOBJECT("CDO.Message")
iConf = CREATEOBJECT("CDO.Configuration")
Flds = iConf.FIELDS
WITH Flds
.ITEM(" = 2
.ITEM(" = 'ourserver' && ourserver
.ITEM(" = 25
.UPDATE()
ENDWITH
WITH iMsg
.Configuration = iConf
.TO = m.emal
.BCC = ""
.FROM = "me@example.ca"
.Subject = "Your Invoice is Now Ready 2024-01"
.FIELDS("Priority").VALUE = 0 && -1=Low, 0=Normal, 1=High
.Fields(" = 1
.Fields(" = 60
.Fields(" = .T.
.FIELDS.UPDATE()
IF has_txt=.F. && HAS ONLY PDF (NO TXT FILE EXISTS)
bod="<img src='cid:logo.png'><BR>Hello,<BR><BR>in PDF.<BR>"
.HtmlBody=bod
ELSE && EXISTS BOTH THE PDF & TXT FILE SO EMAIL BODY IS A LITTLE DIFFERENT
bod="<img src='cid:logo.png'><BR>Hello,<BR><BR>your pdf PDF.<BR>"
.HtmlBody=bod
ENDIF
.AddAttachment ("C:\Users\jk\Desktop\ff\logo.png") && ALWAYS DONE SO THAT EVERYBODY HAS THE LOGO
.SEND()
ENDWITH
iMsg = .NULL.
iConf = .NULL.
Flds = .NULL.
ELSE
MESSAGEBOX("Could not send the message, your internet connection is down.")
ENDIF
PROCEDURE displayState
LOCAL lConnected
lConnected = .F.
lpdwFlags = 0
IF InternetGetConnectedState (@lpdwFlags, 0) = 1
lConnected = .T.
ENDIF
RETURN lConnected
ENDPROC
Thanks,
FOXUP