keepingbusy
Programmer
Regarding Mike Gagnon's FAQ....
How to send e-mail using CDO and checking the connection status first
faq1251-4969
can anyone suggest how to accomplish the following:
I have used Mike's code (which obviously works) to send an email without using Outlook or Outlook express due to Outlook throwing up that "Someone is trying to send etc... and Outlook Express opening each time a automated email is created. Mike's process is very quick and efficient.
We have a table and wish to put the code in a loop to send emails to selected records within that table. MYTABLE contains a memo field where HTML code has been copied and pasted (It's a newsletter created in FrontPage).
When you use the code below, the email is sent but in the body of the received email, you see the HTML code.
Is there anyway to force the HTML code from the memo field into the SOURCE of the body of the email instead of it showing as code?
Here's what we use....
Look forward to any replies
Lee....
Visual FoxPro Versions: 6 & 9
Operating System: Windows XP
How to send e-mail using CDO and checking the connection status first
faq1251-4969
can anyone suggest how to accomplish the following:
I have used Mike's code (which obviously works) to send an email without using Outlook or Outlook express due to Outlook throwing up that "Someone is trying to send etc... and Outlook Express opening each time a automated email is created. Mike's process is very quick and efficient.
We have a table and wish to put the code in a loop to send emails to selected records within that table. MYTABLE contains a memo field where HTML code has been copied and pasted (It's a newsletter created in FrontPage).
When you use the code below, the email is sent but in the body of the received email, you see the HTML code.
Is there anyway to force the HTML code from the memo field into the SOURCE of the body of the email instead of it showing as code?
Here's what we use....
Code:
USE MYTABLE && The memo field in the table is called [b]MAIN[/b]
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("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = 'smtp address here'
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25[/URL]
.Update
Endwith
With iMsg
.Configuration = iConf
.To = "someone AT emailaddress DOT com"
.CC = ""
.BCC = ""
.From = "someone AT emailaddress DOT com"
.Subject = "This is a test"
.TextBody = [b]MAIN[/b]
.Send
Endwith
iMsg = .Null.
iConf = .Null.
wb = .Null.
Else
Messagebox("Could not send the message, you internet connection is down.")
Endif
Procedure displayState
Local lConnected
lConnected = .F.
lpdwFlags = 0
If InternetGetConnectedState (@lpdwFlags, 0) = 1
lConnected = .T.
Endif
Return lConnected
Lee....
Visual FoxPro Versions: 6 & 9
Operating System: Windows XP