West Wind Internet and Client Tools
Sending email with wwSmtp
Gravatar is a globally recognized avatar based on your email address. Sending email with wwSmtp
  Jill Lindgren
  All
  Sep 24, 2017 @ 06:57am

Thanks for the prompt responses. That got me passed that hurdle and onto this one:

"Unable to create SmptClient due to missing permissions. If you are using a port other than 25 for your email server, SmtpPermission has to be explicitly added in Medium Trust."

I tried setting loSmtp.cMailServer to both smtp.gmail.com:587 (like in the example) and plain old smtp.gmail.com (which is what it is set to in their email client software). Do I need to ask their IT company for the right port?

Thank you.

PS I replied to the original thread.. I don't know why it started a new one.

Gravatar is a globally recognized avatar based on your email address. re: Sending email with wwSmtp
  Rick Strahl
  Jill Lindgren
  Sep 24, 2017 @ 04:31pm

Where are you running this from? In a Web application? If so you'll need to follow those instructions by either using trust="Full" or by adding domains to the trusted domains list in medium trust. Both settings are made in web.config of an ASP.NET Web site.

If you're running in a desktop application you should not see that error. If you do maybe you're running from a neetwork share in which case you need to configure network access in the application's app.config file.

More info on the latter is here:

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Sending email with wwSmtp
  Jill Lindgren
  Rick Strahl
  Sep 25, 2017 @ 04:48am

It is a VFP application on a server. Not a web application. I will look into that. Thank you.

Gravatar is a globally recognized avatar based on your email address. re: Sending email with wwSmtp
  Jill Lindgren
  Jill Lindgren
  Sep 29, 2017 @ 10:22am

I'm sorry I keep having to post. I wish I could go away too! 😃

I created the YourApp.exe.config as indicated in the Loading Assemblies from Network Locations. The server is gmail - SSL. Now the message I get is "Unable to read from the transport connection: net_io_connectionclosed.

This is the code I am using.

LOCAL loSMTP as wwSmtp
loSmtp=CREATEOBJECT("wwSmtp")
loSmtp.cMailServer = "smtp.gmail.com:465"
loSmtp.nMailMode = 0
loSmtp.nTimeout = 100
loSmtp.lUseSsl = .T.

loSmtp.cSenderEmail=ALLTRIM(tblsettings.macemail)
loSmtp.cSenderName=ALLTRIM(tblsettings.maxname)
loSmtp.cUsername = ALLTRIM(tblsettings.macuser)
loSmtp.cPassword = ALLTRIM(tblsettings.macpw)

loSmtp.cMessage=myfile.mfilecontents
loSmtp.cContentType = "text/html"


llResult = loSmtp.SendMail()      
IF !llResult
	Wait window loSmtp.cErrorMsg
ENDIF
loSmtp.cLogFile = FULLPATH("SmtpLog.txt")
		 

this is my config:

<configuration>
  <runtime>
     <loadFromRemoteSources enabled="true"/>
  </runtime>
</configuration>
Gravatar is a globally recognized avatar based on your email address. re: Sending email with wwSmtp
  Rick Strahl
  Jill Lindgren
  Oct 4, 2017 @ 12:56pm

Are you sure the port you're using for the gmail SMTP server is correct? I always use port 587.

Here's an example of send email with gmail via SSL:

+++ Rick ---

© 1996-2024