FoxPro Programming
wwClient
Gravatar is a globally recognized avatar based on your email address. wwClient
  Foxpro Programer
  All
  Jun 8, 2020 @ 03:39pm

Hi,

I downloaded the wwClient. I want to try wwSmtp. When I run the program called wwclient\samples\wwsmtp_sample.prg I run into an error

*** Load required libraries****
DO wwSmtp

ERROR: File "wwSmtp.prg" do not exist

I try to locate that file but can't find it. Can someone tell me how to run this program? Do I miss something here?

thank you for your time

Gravatar is a globally recognized avatar based on your email address. re: wwClient
  Rick Strahl
  Foxpro Programer
  Jun 8, 2020 @ 07:58pm

You need to load the libraries.

if your're running the shareware version:

do wwClient   && wwclient.app

loSmtp = CREATEOBJECT("wwSmtp")
...

In the registered version you can load the library files (and their dependencies) individually:

do wwSmtp

loSmtp = CREATEOBJECT("wwSmtp")
...

Files are found in the root install folder, so you have to set the FoxPro path so that the libraries can be found if they are not in the current folder.

More info here:

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwClient
  Foxpro Programer
  Rick Strahl
  Jun 9, 2020 @ 09:33am

Thank you for your help, your time and fast response.

I try to translate a NODE.JS program in foxpro. In NODE It works good, when I try the settings with another tool on the web https://www.smtper.net/ , then it works no problem.

but in foxpro, I cannot get it works. I tried 3 differents tool in foxpro and can't get it works. Always the same error "503 AUTH command used when not advertised" Do you have any ideas why it's not working with Fox ? I suspect the SMTP server !?

Is there any extra settings I need ?

const nodemailer = require("nodemailer");
async function main() {
  let transporter = nodemailer.createTransport({
    host: "hosting.domain.ca",
    port: 587,
    secure: false, // true for 465, false for other ports
    auth: {
      user: "admin@domain.com",
      pass: "passD9JYMrUpOB"
    },
  });

  // send mail with defined transport object
  let info = await transporter.sendMail({
    from: '"Node" <admin@domain.com>', // sender address
    to: "friend@gmail.com", // list of receivers
    subject: "Hello ?", // Subject line
    text: "Hello world?", // plain text body
    html: "<b>Hello world?</b>", // html body
  });

  console.log("Message sent: %s", info.messageId);
  console.log("Preview URL: %s", nodemailer.getTestMessageUrl(info));
}
main().catch(console.error);

#INCLUDE wconnect.h
local loSmtp 
CLEAR

*** Load required libraries
DO wwClient

LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")
loSmtp.nMailMode = 2
loSmtp.cMailServer = "hosting.domaine.ca:587"   && add a port number with :587
loSmtp.nTimeout = 10
loSmtp.lUseSsl = .f.
loSmtp.cUserName = "admin@domaine.com"
loSmtp.cPassword = "passD9JYMrUpOB"
loSmtp.cSenderName= "admin@domaine.com"
loSmtp.cSenderEmail = "admin@domaine.com"
loSmtp.cRecipient = ["friend" <friend@gmail.com>]
loSmtp.cSubject = "wwSMTP Test Message"
loSmtp.cMessage = "<b>HTML Test message from wwsmtp, to check out how this operation works.</b>"
loSmtp.cContentType = "text/html"
loSmtp.cReplyTo = "admin@domaine.com"
loSmtp.cPriority = "Normal"
#IF .T.
	llResult = loSmtp.Sendmail()
	IF llResult
	   WAIT WINDOW "Mail sent..." nowait
	ELSE
		? "Mail sending failed: " 
		? loSmtp.cErrorMsg
	ENDIF	
#ENDIF

Gravatar is a globally recognized avatar based on your email address. re: wwClient
  Rick Strahl
  Foxpro Programer
  Jun 9, 2020 @ 01:51pm

Don't know. It sounds like the server is not using SMTP or ESMTP perhaps?

Also normally port 587 is the secure port (ie. usually uses TLS/SSL)...

+++ Rick ---

© 1996-2024