Home
Level Extreme platform
Subscription
Corporate profile
Products & Services
Login
FRANÇAIS
Home
FRANÇAIS
Level Extreme platform
Login
Best practices
Testimonials
Downloads
Articles
Subscription
Subscribe or renew
Benefits
Donate 5$
Donate 10$
Donate 15$
Donate 20$
Donate 25$
Corporate profile
Overview
Portfolio
Products & Services
Consulting services
Enterprise hosting
Web Site Hosting
Graphic design
Book publishing
Support
Troubleshooting
Problem with logins
Contact us
Legal
Copyright
Privacy policy
Terms & Conditions
Français
Send Email Through Gmail
Message
From
23/05/2011 03:15:01
Mohammed Raniwala
DataSpeed
India
To
12/05/2011 17:01:40
Sergey Berezniker
New York
,
United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Re:
Send Email Through Gmail
Miscellaneous
Thread ID:
01510492
Message ID:
01511452
Views:
263
LOCAL loConfig AS CDO.Configuration, loFlds AS Object, loMsg AS CDO.Message
SET STEP ON
loConfig = CREATEOBJECT("CDO.Configuration")
loFlds = loConfig.Fields
WITH loFlds
*- Set the CDOSYS configuration fields to use port 25 on the SMTP server.
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing
") = 2
*- Enter name or IP address of remote SMTP server.
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserver
") = "smtp.gmail.com"
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserverport
") = 465
*- Assign timeout in seconds
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout
") = 10
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpusessl
") = .t.
*- Commit changes to the object
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusername
") = "
youraccout@gmail.com
"
.Item("
http://schemas.microsoft.com/cdo/configuration/sendpassword
") = "password"
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
") = 3
* .item("
http://schemas.microsoft.com/cdo/configuration/cdoURLProxyServer
") = "smtp.mail.yahoo.com"
.Update()
ENDWITH
*- Create and send the message.
loMsg = CREATEOBJECT("CDO.Message")
WITH loMsg
.Configuration = loConfig
.To = "
test@test.com
"
.From = "
youraccount@gmail.net
"
.Subject = "This is a test of CDO sending e-mail"
.HTMLBody = "This is the HTML content of the mail message"
.AddAttachment("path of the file")
*- Set priority to HIGH if needed
*!* IF tlUrgent
*!* .Fields("Priority").Value = 1 && -1=Low, 0=Normal, 1=High
*!* .Fields.Update()
*!* ENDIF
TRY
.Send()
CATCH TO oerr
MESSAGEBOX(oerr.message)
ENDTRY
ENDWITH
Previous
Next
Reply
Map
View the map of this thread
View the map of this thread starting from this message only
View
View all messages of this thread
View all messages of this thread starting from this message only
Click here to load this message in the networking platform
Level Extreme platform
Best practices
Testimonials
Downloads
Articles
Subscription
Subscribe or renew
Benefits
Donate 5$
Donate 10$
Donate 15$
Donate 20$
Donate 25$
Corporate profile
Overview
Portfolio
Products & Services
Consulting services
Enterprise hosting
Web Site Hosting
Graphic design
Book publishing
Support
Troubleshooting
Problem with logins
Contact us
Legal
Copyright
Privacy policy
Terms & Conditions
Login
Google
Copyright © 1993-2024 by Level Extreme Inc. All rights reserved · Website by
levelextreme.com