When trying to send email I get the following error message:
I have been told to create a config file which I have done:
Below are the settings for the outlook email account:
The latest framework file for .net has been installed.
This is the code I use:
* Create console log file
DELETE FILE ~console.prn
SET ALTERNATE TO ~console.prn
SET ALTERNATE ON
***** Email procedures *********
#define WWIPSTUFF_SHAREWARE .F.
SET PATH TO ".\classes" ADDITIVE
*** Core classes
SET PROCEDURE TO wwHTTP ADDITIVE
SET PROCEDURE TO wwUtils ADDITIVE
SET PROCEDURE TO wwAPI ADDITIVE
SET PROCEDURE TO wwEval ADDITIVE
SET PROCEDURE TO wwDotNetBridge Additive
SET PROCEDURE TO wwSMTP ADDITIVE
LOCAL loSMTP as wwSmtp
loSmtp=CREATEOBJECT("wwSmtp")
loSmtp.nMailMode = 0
loSmtp.cMailServer = "mail.computergear.org:465"
loSmtp.nTimeout = 100
loSmtp.lUseSsl = .T.
PUBLIC llrecstorun
loSmtp.cSenderEmail="markm@computergear.org"
loSmtp.cSenderName="Customer Service"
loSmtp.cUsername = "markm@computergear.org"
loSmtp.cPassword = "rxx3787"
*loSmtp.cRecipient = "tracking-update@store.yahoo.com"
loSmtp.cRecipient = "markm@computergear.org"
loSmtp.cSubject=""
lchtmltxt = "webshipxml.txt"
lchtmltxt = "'" + lchtmltxt + "'"
lcFileContents = FILETOSTR(&lchtmltxt)
CREATE CURSOR myfile (mfilecontents M)
INSERT INTO myfile VALUES (lcFileContents)
lcOrderno = '"'+'ComputerGear - '+ALLTRIM(lnOrderId)+'"'
lcNewFileContents = STRTRAN(lcFileContents,'#Orderno',lcOrderno)
lcNewFileContents = STRTRAN(lcNewFileContents,"#Tracking", ALLTRIM(lcTracking))
lcNewFileContents = STRTRAN(lcNewFileContents,"#shipper", ALLTRIM(lcCarrierCode))
loSmtp.cMessage=myfile.mfilecontents
loSmtp.cContentType = "text/html;charset=utf-8;"
llResult = loSmtp.SendMail()
IF !llResult
MESSAGEBOX(loSmtp.cErrorMsg")
ENDIF
loSmtp.cLogFile = FULLPATH("SmtpLog.txt")
Additionally, the log file does not create, so I cannot see what might be the problem.
Help is beyond greatly appreciated.
Thanks.
Well that error message is your error message, right? So the error may actually be something different?
What is the actual error that's occurring...
You can have issues with firewalls and AV software when sending but those will be generated when actually sending the message itself, not when the object is created. Permission errors with access to the client will usually happen when the object is created.
+++ Rick ---
It actually is not my error message. It is the error thrown by this line:
llResult = loSmtp.SendMail()
IF !llResult
MESSAGEBOX(loSmtp.cErrorMsg)
ENDIF
To which I only added:
llResult = loSmtp.SendMail()
IF !llResult
MESSAGEBOX(loSmtp.cErrorMsg +"Screen shot and send to Jill Lindgren")
ENDIF
I have a wmv file that shows the user stepping through the code and shows where it is when it throws that error along with the window to show the variables, etc. at the time. I can send this to you if you would like. I don't see a way to attach video here.
I do notice that the loSmpt.cMailerServer = "mail.computergear.org:465" to indicate the port is 465 but nserverport is set to 25 in the debugging window. Could that have something to do with it and if so where/what do I change for it to look at the right port?
Can you try running the application under an Admin account (use Run As Administrator) and see if that changes.
Another thing to try inside of that app try accessing some HTTP content and see if that also fails. You may get different failure info if it does.
My guess it's a block at the firewall or machine policy that doesn't allow SMTP connections on non-default ports. The error is a security exception so Windows basically says "You can't access this port" to send email. Could be AV, could be the firewall or could be system policy.
+++ Rick ---
Hi.
You are above my head in your reply. I do not know how to send Http content.
Are you saying there is a chance due to AV, firewall or system policy that I simply can't use your tools or are there settings that can be changed to make it work? As someone with no knowledge of system policies and security, this seems a bit daunting.
Yes it's possible that AV or the Firewall is blocking you. To check turn off firewall and away temporarily and see if you get different results.
If it's firewall you can add a special rule by application or specific ports. If it's AV - it'll depend on AV.
Are you running from the network? If so try running from the local drive.
+++ Rick ---