Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending e-mail from COM in ASP page
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00603807
Message ID:
00603958
Vues:
18
Yes, just checked and it will run with Win2k professional and any version of IIS with SMTP mail going back to NT...
>Does that require Windows 2000 Server or will it run on Windows 2000 Professional?
>
>>Paul, we do it all the time with VFP COM called from ASP with the included IIS SMTP server - works good all the time. Demo at http://www.dotcomsolution.com/avfpdemo15/avfpdemo15.asp?action=email1 . Here's some code for it:
>>
>>************************************************************************
>>
>>* server :: email
>>
>>*********************************
>>
>>*** Function: Send SMTP email using CDONTS. Requires IIS SMTP service running.
>>
>>************************************************************************
>>FUNCTION email
>>LOCAL lcFileName, lcFileDesc
>>#DEFINE CdoBodyFormatHTML 0 && Body property is HTML
>>#DEFINE CdoBodyFormatText 1 && Body property is plain text (default)
>>#DEFINE CdoMailFormatMime 0 && NewMail object is in MIME format
>>#DEFINE CdoMailFormatText 1 && NewMail object is plain text (default)
>>#DEFINE CdoLow 0 && Low importance
>>#DEFINE CdoNormal 1 && Normal importance (default)
>>#DEFINE CdoHigh 2 && High importance
>>#DEFINE CdoEncodingUUencode 0 && The attachment is to be in UUEncode format (default)
>>#DEFINE CdoEncodingBase64 1 && The attachment is to be in base 64 format
>>
>>lcFileName=THIS.FORM("txtMailAttachment")
>>lcFileDesc=THIS.FORM("txtMailFileDesc")
>>oMail = CreateObject("CDONTS.Newmail")
>>oMail.MailFormat = cdoMailFormatMIME
>>IF !EMPTY(THIS.FORM("txtMailFrom"))
>> oMail.From = THIS.FORM("txtMailFrom")
>>ENDIF
>>IF !EMPTY(THIS.FORM("txtMailTo"))
>> oMail.To = THIS.FORM("txtMailTo")
>>ENDIF
>>IF !EMPTY(THIS.FORM("txtMailBcc"))
>> oMail.bcc = THIS.FORM("txtMailBcc")
>>ENDIF
>>IF !EMPTY(THIS.FORM("txtMailReplyTo"))
>> oMail.Value("Reply-To") = THIS.FORM("txtMailReplyTo")
>>ENDIF
>>IF !EMPTY(THIS.FORM("D1"))
>> oMail.Importance = VAL(THIS.FORM("D1"))
>>ENDIF
>>IF !EMPTY(THIS.FORM("txtMailSubject"))
>> oMail.Subject = THIS.FORM("txtMailSubject")
>>ENDIF
>>IF !EMPTY(THIS.FORM("S1"))
>> oMail.Body = THIS.FORM("S1")
>>ENDIF
>>IF !EMPTY(lcFileName) .AND. FILE(lcFileName)
>> oMail.AttachFile(lcFileName,lcFileDesc)
>>ENDIF
>>oMail.Send
>>lchtmlfile = 'email2.htm'
>>lcHTMLout= FILETOSTR(THIS.cHTMLpath+lchtmlfile)
>>RETURN oAVFP.mergetext(lcHTMLout)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform