West Wind Internet and Client Tools
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 explicit
Gravatar is a globally recognized avatar based on your email address. 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 explicit
  Abe Dagher
  All
  Jul 6, 2021 @ 04:29pm

Hello Rick,

I have tried to send an email over a mapped drive and I received "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 did search for solutions and I have found this link that you have created:

https://webconnection.west-wind.com/docs/?page=_36e0qlogr.htm&page=_36e0qlogr.htm

You have mentioned "The key is the loadFromRemoteSource key which can be set to allow remote .DLL loading to occur."

Also you have mentioned that I need to create YourApp.exe.config which includes configuration settings for loadFromRemoteSources enabled="true"

Please if you can guide me step by step on what I need to do to make it work. I'm not sure on how to follow your instructions in the above link.

	Do wwSmtp
	loSmtp = Createobject("wwSmtp")
	loSmtp.nMailMode = 0 && .NET

	loSmtp.cContentType = "text/html"

	loSmtp.cMailServer = "smtp.office365.com:587"
	loSmtp.lUseSsl = .T.

	*---------- email from:
	loSmtp.cSenderEmail = "abc@123.com"
	loSmtp.cSenderName = "Sender"

	*---------- login email info:
	loSmtp.cUsername = "abc@123.com"
	loSmtp.cPassword = "123"

	*---------- email to:
	loSmtp.cRecipient=  "defg@456.com"

	*---------- email subject and body
	loSmtp.cSubject= ""
	loSmtp.cMessage = ""

	Wait Window "Attaching document, please wait" Nowait
	loSmtp.cAttachment = Alltrim(lcfilename)

	loSmtp.nTimeout = 30	&& default is 10

	*----------
	llResult = loSmtp.SendMail()

Thank you, Abe

Gravatar is a globally recognized avatar based on your email address. re: 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 expl
  Rick Strahl
  Abe Dagher
  Jul 6, 2021 @ 07:14pm

I'm not sure how to make the instructions any clearer than they are in the help file.

You need to create yourapp.exe.config in the same folder as your application's exe file (with the same name as your EXE file instead yourapp).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: 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 expl
  Abe Dagher
  Abe Dagher
  Jul 6, 2021 @ 08:11pm

Hi Rick,

I did create this file opgcrm.exe.config in the same folder as my application's exe file orgcrm.exe and still got that message. Do I need to do something for orgcrm.exe to see opgcrm.exe.config?

Thanks,

Abe

Gravatar is a globally recognized avatar based on your email address. re: 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 expl
  Rick Strahl
  Abe Dagher
  Jul 7, 2021 @ 09:50am

Not sure then. Try running off the local drive and see if that changes behavior. If not you have a security policy configuration issue on the machine that restricts operation.

What OS, .NET Version and wwDotnetBridge version?

do wwDotNetBridge
LOCAL loBridge as wwDotNetBridge
loBridge = GetwwDotnetBridge()
? loBridge.GetDotnetVersion()

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: 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 expl
  Abe Dagher
  Rick Strahl
  Jul 7, 2021 @ 07:41pm

Hello Rick,

The wwDotNetBridge I'm using is an old one 5.63.0.0. However, I did order an upgrade a while back for version 7.15.6.0. The OS is Windows Server 2012R2 and .NET Version is both 3.5 and 4.5.

I will do the upgrade and see how it goes.

I will let you know if it works after the upgrade to version 7.15.6.0 .

Thank you for all your help !!!

Abe

Gravatar is a globally recognized avatar based on your email address. re: 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 expl
  Rick Strahl
  Abe Dagher
  Jul 8, 2021 @ 12:04pm

Are you running this from within a COM Server in ASP.NET or IIS as an MTDLL?

If so then the issue is likely Medium Trust in the IIS site configuration and you'll have to either run in full trust or assign specific priviliges for the email domain...

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: 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 expl
  Abe Dagher
  Abe Dagher
  Jul 8, 2021 @ 12:38pm

Hi Rick,

I'm not running this from within a COM Server in ASP.NET or IIS as an MTDLL. The sender email is an office365 email account I have with GoDaddy for my company domain.

Do you think this may be the problem?

Abe

Gravatar is a globally recognized avatar based on your email address. re: 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 expl
  Rick Strahl
  Abe Dagher
  Jul 8, 2021 @ 05:29pm

No the error is a permissions error - Windows policy. What account is this running under?

Again - try running from a local drive and see if this works. If it does you know the problem is policy.

+++ Rick ---

© 1996-2021