SV Communication email smtp.gmail.com SSL

Does anybody use SV’s Communication Template with any degree of success? Right now I am very interested in the email bit.
I have been using NetTalk exclusively and it works perfectly - but now I must write an app for another developer who does not want to use any 3rd party products/templates - you know - the going out of business thingy and subsequent lack of support and no upgrades/updates.

The plan is to use a Process to loop through a TPS file and send email to all records that qualify, attaching a personalized PDF, like an invoice for instance, using smtp.gmail.com.

If no 3rd party stuff - what options do I have? I only found SV’s Communication template and its two sample apps SMTPDemo and EmailDemo(well, not an app, just a .CLW). EmailDemo works perfectly, it sends the email via smtp.google.com and with or without attachment. BUT it is not an .APP, has no .DCT or templates.
SMTPDemo is dated 2013 and it does not work, as I see it, because it does not cater for SSL .
Any help will be appreciated. Please be patient with me, last used Clarion on any significant scale in 2010, except for NetTalk WS and some C6 work.

Why not to take the code from working handcoded project and put into an app? It is very simple.

Hi Johan,

Why not use the Excellent work of Mike Duglas that he did with LibCurl.

I have just finished making a Clarion 6.3 Example app that Mike will put up on the site as soon as he has checked it and made sure it is correct.

Very easy and works perfect.

Regards

Johan de Klerk

My client does not want to use any non SV template/tool/product.

Like Mike said, why not just use this as the basis for your implementation?

It’s using the shipping ClaRunExtClass and you could create your own Clarion procedure to send mail something like this:

MySendMail PROCEDURE(...send some parameters...)
ClaTalk             ClaRunExtClass
errorCode LONG
  CODE

  errorCode = ClaTalk.SendMail(...fill in all the parameters...)

Now granted there is pretty much no documentation on this but once you know they are wrappers around the .NET classes then you should be able to figure enough to get you going. What do you need templates for!

Another great option for email is to use a service like SendGrid. As long as you can make HTTP call you are all set. See ClaTalk.HttpWebRequest :slight_smile:

You could argue that GMail falls into that trap as well. Granted they are bigger than SV but they do shift the requirements on usage of their SMTP services from time to time.

SmtpClient Class

Definition

Namespace:

System.Net.Mail

Assemblies:

System.dll, netstandard.dll, System.Net.Mail.dll

Warning

This API is now obsolete.

No problems using SV’s Communication to send e-mails. I guess it is sending as POP mail. I got nothing in my send elements and how will it be on an exchange server. You got to have a copy of your sent e-mails.

On the other hand, the message will not send Norwegian characters. That is another problem.

ClaTalk.SendMail(… causes
No matching prototype available

MySendMail           PROCEDURE  (STRING pSMTPServerHost, STRING pSMTPLoginUserName, STRING pSMTPLoginPassword, LONG pSMTPPort, LONG pSMTPEnableSsl, LONG pSMTPForceCertCheck, LONG pshowErrorMessage, LONG preceiveRequest, STRING pmessageBodyEncoding, STRING pfromAddress, STRING ptoAddress, STRING preplyToAddress, STRING psubject, STRING phtmlMessage, STRING pembeddedImageFileNames, STRING ptextMessage, STRING pattachedFileNames, STRING pccList, STRING pbccList, <*STRING perrMessage>)!,LONG ! Declare Procedure
! Start of "Data Section"
! [Priority 1300]
ClaTalk   ClaRunExtClass
errorCode LONG
! End of "Data Section"
! Start of "Local Data After Object Declarations"
! [Priority 5000]

! End of "Local Data After Object Declarations"

  CODE
! Start of "Processed Code"
! [Priority 4000]
errorCode = ClaTalk.SendMail(SMTPServerHost, SMTPLoginUserName, SMTPLoginPassword, SMTPPort, SMTPEnableSsl, SMTPForceCertCheck, showErrorMessage, receiveRequest, messageBodyEncoding, fromAddress, toAddress, replyToAddress, subject, htmlMessage, embeddedImageFileNames, textMessage, attachedFileNames, ccList, bccList, errMessage)
return errorcode

where all these variables are declared?

SMTPServerHost, SMTPLoginUserName, SMTPLoginPassword, SMTPPort, SMTPEnableSsl, SMTPForceCertCheck, showErrorMessage, receiveRequest, messageBodyEncoding, fromAddress, toAddress, replyToAddress, subject, htmlMessage, embeddedImageFileNames, textMessage, attachedFileNames, ccList, bccList, errMessage

Resolved, managed to use SV Comms Template successfully.

How do I enable SSL/TLS using SV messaging template?

1 Like

Hi
I have coded my app as per the EmailDemo.clw
Any idea why I get error 99 when calling :-
Loc:Error = ClaTalk.SendMail(GLO:SenderEmailServer,GLO:SenderServerUserName,GLO:SenderServerPassword,GLO:SenderServerPort,GLO:SenderServerSSL,FALSE,FALSE,GLO:messageBodyEncoding,GLO:SenderEmail,EQ:RecipientAddress,GLO:SenderEmail,Loc:EmailSubject,Loc:EmailSubject,GLO:embeddedImageFileNames,Loc:EmailBodyText,EQ:EmailAttFilename,GLO:cc,GLO:bcc,GLO:ErrorMessage)