I need to send an email with up to 4 attachments from my gmail account. Can I do this with WW classes (e.g. wwsmtp.prg)?
If so,
- Specifically, Which files do I need in my project?
- Other files needed in other folders?
- Are there any step-by-step instructions to make this happen?
I've tried Blat, Mail Alert, Mail Send, Foxypreviewer. All had problems, some worked with my Verizon account but not with Gmail. I've tried smtp sample substituting parameters (e.g. port 465) to no avail. Google is no help of course.
Thanks for any help.
Steve
Yes you can send emails using GMails SMTP server. I don't think port 465 is correct. They use port 587 for TLS connections.
This works for me (using the wwSmtp Sample provided):
*** Load required libraries
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")
*** Select mail mode. 0 - .NET wwSmtp 2 - Classic wwIPstuff (default)
*** Note: Mode 2 only supports SendMail and SendMailAsync
*** and no support for alternate views
loSmtp.nMailMode = 0
loSmtp.cMailServer = "smtp.gmail.com:587"
*** Timeout in seconds
loSmtp.nTimeout = 25
*** Optionally use SSL/TLS if the mail server requires it
loSmtp.lUseSsl = .T.
*** Specify user name and password if auth is required
loSmtp.cUsername = "yourname22@gmail.com"
loSmtp.cPassword = "seekret"
loSmtp.cSenderName= "wwIPstuff Samples"
loSmtp.cSenderEmail = "support@mydomain.com"
*** The following are all comma delimited recipient lists of email addresses
*** you can optionally use "Name" <email@address.com> as the format to
*** have a display name
loSmtp.cRecipient = [jimmyd@mydomain.com,"John" <johndoe@mydomain.com>]
*** Actual message properties
loSmtp.cSubject = "wwSMTP Test Message"
loSmtp.cMessage = "<b>HTML Test message from wwsmtp, to check out how this operation works.</b>"
*** If cMessage contains HTML set cContentType to text/html
loSmtp.cContentType = "text/html"
loSmtp.AddAttachment("c:\sailbig.jpg")
*** Single Mail Sending - connect/disconnect for message
#IF .T.
llResult = loSmtp.Sendmail()
IF llResult
WAIT WINDOW "Mail sent..." nowait
ELSE
? "Mail sending failed: "
? loSmtp.cErrorMsg
ENDIF
#ENDIF
Just change the username and password and recipient.
+++ Rick ---
Thanks, Rick.
"*** Load required libraries"
I guess I need the kindergarden version. What are the required libraries I need to load. Is it SET LIBRARY TO...?
Steve
DO wwSmtp
loads the libraries needed.
Just make sure to distribute wwipstuff.dll, wwsmtp.dll and wwdotnetbridge.dll.
+++ Rick ---
Sorry, there's no wwsmtp.dll. Just the other two... wwsmtp.prg is the main file that holds the component but it's just a prg file.
+++ Rick ---
Still doesn't work. I've tried everything I could think of. Could not get WW to connect. Could be my computer (Win10). I don't know. So at this point, I don't think buying WW would work for me. Anyway, thanks for your help.
Steve
What error are you getting?
Also you might have to check your firewall to make sure you can get out to the Internet on port 587 from your app.
I see no reason why this shouldn't work for you.
+++ Rick ---
File wwsmtp.prg does not exist. How do I get it and where should I place wwipstuff.dll and wwdotnetbridge.dll. Are these two required?
Instead of replying to a 4 years old message, please create a new thread.
You need to use the West Wind Client Tools which includes these files.
+++ Rick ---