No matter what I do (and I'm working with a network administrator) in trying to get the smtp to work, I continue to get "2021.02.4 09:59:34:366 - rec: 504 5.7.4 Unrecognized authentication type"
Here's the code:
do wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")
** On the cMailSesrver, tried no ports (25, 2525, and others provided by admin)
loSmtp.cMailServer = "remote.domain.com:2525"
loSmtp.cSenderEmail = "develop@domain.com"
loSMtp.cSenderName = "companyName - Department"
losmtp.cusername = 'develop@domain.com'
losmtp.cpassword = 'password'
** Optional SSL/TLS connection
*loSmtp.LUseSsl = .T.
losmtp.clogfile = 'm:\apps\aei\fax\wwsmtpWithTLSlog_0959.txt'
losmtp.cRecipient = 'emailAddress@tx.rr.com'
losmtp.cSubject = 'smtp Send test'
losmtp.cContentType = 'text/html'
losmtp.cMessage = 'This is a test sending from smtp'
*** Optionally provide an alternate content type or plain text fallback
loSmtp.cAlternateContentType = "text/plain"
loSmtp.cAlternateText = "Plain text can go here."
IF !loSmtp.SendMail()
wait window loSmtp.cErrorMsg
RETURN
ELSE
wait wind 'SENT'
ENDIF
Does the server require SSL/TLS? If so you need to set that flag and ensure you're using the .NET handler (which I think is the default now).
Could also be that the server is using not an SMTP/ESMTP server, but an IMAP server in which case this class won't work.
+++ Rick ---
I was working with the network admin and was flipping the lUseSsl both ways with various port to no avail.
When you say, "ensure you're using the .NET handler (which I think is the default now).", is that to set the nMailMode = 2 ?
.NET Mode is .nMailMode = 0
which is NOT the default. Just checked now - but I'm going to switch that to 0 as the default, since these days it seems every server requires TLS. Mode 0 doesn't break behavior so that should be safe even for existing apps.
Yea, sorry Rick, I meant to post a parameter of '0';
When I use the .NET mode, it's throwing all kinds of errors. Is there something I can/should do with insuring .net libraries are in place and are accessible?
What type of errors?
+++ Rick ---
Unknown member ODOTNETBRIDGE
this.oDotNetBridge.LoadAssembly("System")
What version of Client Tools and what version of Windows?
I'm not sure how that's possible given the code that runs. There should be an error thrown before you get to that code.
IAC you need to have .NET 4.5 or later on the machine. For Windows XP and 7 that means it has to be installed. It doesn't work on Windows XP.
+++ Rick ---