This is not true. I'm using CDO with SSL without problems.paquitohm wrote:CDO does not allow sending from accounts with the SSL protocol,
Send Emails from Fivewin application
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Send Emails from Fivewin application
Re: Send Emails from Fivewin application
Hello Ruth. I don't use it anymore. I don't remember exactly, but I think it caused problems for customers and I removed it from the line. I don't remember how to do it anymore. I am really sorry.
Hola Rut. Ya no lo uso. No lo recuerdo exactamente, pero creo que causó problemas a los clientes y lo eliminé de la línea. Ya no recuerdo cómo hacerlo. Lo siento mucho.
Look this:
https://forums.fivetechsupport.com/view ... il#p142165
Regards, saludos.
Hola Rut. Ya no lo uso. No lo recuerdo exactamente, pero creo que causó problemas a los clientes y lo eliminé de la línea. Ya no recuerdo cómo hacerlo. Lo siento mucho.
Look this:
https://forums.fivetechsupport.com/view ... il#p142165
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Send Emails from Fivewin application
Enrico Maria Giordano wrote:This is not true. I'm using CDO with SSL without problems.paquitohm wrote:CDO does not allow sending from accounts with the SSL protocol,
sorry, I meant TLS
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Send Emails from Fivewin application
It should work, but I never checked it myself. Do you have any sample (with userid and password) that you can share (at least with me), so I can test it here?paquitohm wrote:sorry, I meant TLS
Re: Send Emails from Fivewin application
What is the working solution to send emails with FWH? that works with or without Outlook installed and accepts attachments and any protocols?
thanks
thanks
Re: Send Emails from Fivewin application
In his day I already hit him too many heads to prepare a test now. I came out of that very fed up and saw that Harbour is not up to par in terms of emails. That everyone suggests hb_sendmail() but they have not tried it and that the development of this in harbour currently and in the future will always leave something to be desired. So I chose to do it with a universal Windows, without installations, third party tool: powershellEnrico Maria Giordano wrote:It should work, but I never checked it myself. Do you have any sample (with userid and password) that you can share (at least with me), so I can test it here?paquitohm wrote:sorry, I meant TLS
In my case I send from an outlook account on port 587 using TLS
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Send Emails from Fivewin application
There are more than one posibilities. Personally, I'm still using CDO.NWKL wrote:What is the working solution to send emails with FWH? that works with or without Outlook installed and accepts attachments and any protocols?
thanks
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Send Emails from Fivewin application
Sounds interesting. Can you share a sample, please?paquitohm wrote:In my case I send from an outlook account on port 587 using TLS
Re: Send Emails from Fivewin application
In my case I used ChatGPT to learn PowerShell. It helped me create a .ps1 file which I finally called from harbour.
An .ini file is generated as input and that same file is modified, recording whether or not the sending has been possible.
My .ps1 process is really complex. I would have to clean it a little, it's not exactly easy. IMHO it would help more to ask Chat GPT for a simple example, but regardless, you should. He still wants it, later I can clean it and paste it in the forum, but of course I would also require an example of a call. It's really a job
An .ini file is generated as input and that same file is modified, recording whether or not the sending has been possible.
My .ps1 process is really complex. I would have to clean it a little, it's not exactly easy. IMHO it would help more to ask Chat GPT for a simple example, but regardless, you should. He still wants it, later I can clean it and paste it in the forum, but of course I would also require an example of a call. It's really a job
Re: Send Emails from Fivewin application
Enrico Maria Giordano wrote:Sounds interesting. Can you share a sample, please?paquitohm wrote:In my case I send from an outlook account on port 587 using TLS
From ChatGPT, simple sample:
Code: Select all | Expand
# script1.ps1
# Definir los parámetros
$CorreoDe = "tu_correo@outlook.com"
$CorreoPara = "correo_destino@example.com"
$Asunto = "Asunto del correo"
$Cuerpo = "Cuerpo del correo"
$SMTPServer = "smtp-mail.outlook.com"
$SMTPPort = 587
$Credenciales = Get-Credential -Message "Por favor, introduce tu correo y contraseña"
# Crear el objeto de correo
$Correo = New-Object System.Net.Mail.MailMessage($CorreoDe, $CorreoPara, $Asunto, $Cuerpo)
# Crear el objeto SMTP
$SMTP = New-Object Net.Mail.SmtpClient($SMTPServer, $SMTPPort)
$SMTP.EnableSsl = $true
$SMTP.Credentials = New-Object System.Net.NetworkCredential($Credenciales.UserName, $Credenciales.Password);
# Enviar el correo
$SMTP.Send($Correo)
Code: Select all | Expand
FUNCTION Main()
LOCAL cCommand
// Define el comando para ejecutar el script de PowerShell
cCommand := "powershell.exe -File C:\ruta_a_tu_script\script1.ps1"
// Llama al comando
Run (cCommand)
RETURN
Re: Send Emails from Fivewin application
Dear friends,
thank you once again for your kind help and directions.
Through reading the topics you suggested and then with the help of chatgpt I managed to make it work. The image is now inline embedded as related attachement. Working perfectly. Thank you again.
And also thank you for pointing me to PowerShell - this sound like a lot to learn, but really interesting.
Kind regards to all of you and a very happy birthday to mod_harbour
Ruth
thank you once again for your kind help and directions.
Through reading the topics you suggested and then with the help of chatgpt I managed to make it work. The image is now inline embedded as related attachement. Working perfectly. Thank you again.
And also thank you for pointing me to PowerShell - this sound like a lot to learn, but really interesting.
Kind regards to all of you and a very happy birthday to mod_harbour
Ruth
Code: Select all | Expand
// C:\FWH\SAMPLES\RUTHMAIL.PRG
#include "FiveWin.ch"
#Include "Outlook.ch"
#Include "Mail.ch"
MEMVAR smtpserver, serverport, sendusing, authenticate, usessl, username, ;
password, timeout
MEMVAR cFrom, cTo, cSubject, cTextBody, cImgBase64, cImgPath, cBase64
FUNCTION Main()
PRIV smtpserver, serverport, sendusing, authenticate, usessl, username, ;
password, timeout
PRIV cFrom, cTo, cSubject, cTextBody, cImgBase64
smtpserver := ""
serverport := 587
sendusing := 2
authenticate := .T.
usessl := .F. // .T. or .F.
username := "" //<your_email>
password := "" // <sua_senha>
timeout := 60
cFrom := ""
cTo := ""
cSubject := "RUTH an RUTH"
// cTextBody := "RUTH: Teste de Email-Only TEST"
cImgPath := "c:\fwh\samples\img\start_slide1.jpg"
cImgBase64 := hb_base64encode(MEMOREAD("c:\fwh\samples\img\start_slide1.jpg"))
SendMailCDO()
RETURN NIL
FUNCTION SendMailCDO()
LOCAL objMsg, cHtml, oError, loBP
LOCAL msgConf, lRet := .F.
/*
? smtpserver, serverport, sendusing, authenticate, usessl, username, ;
password, timeout
*/
//' Server Configuration
TRY
msgConf := CreateObject("CDO.Configuration")
WITH OBJECT msgConf:Fields
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ):Value := smtpserver
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ):Value := serverport
:Item( "http://schemas.microsoft.com/cdo/configuration/sendusing" ):Value := sendusing
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ):Value := authenticate
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ):Value := usessl
:Item( "http://schemas.microsoft.com/cdo/configuration/sendusername" ):Value := username
:Item( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ):Value := password
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"):Value := timeout
:Update()
END WITH
CATCH oError
MsgInfo("Configuration instance object error " + ";" + CRLF+ ;
"Error: " + TRANSFORM(oError:GenCode, NIL) + ";" + CRLF+;
"SubC: " + TRANSFORM(oError:SubCode, NIL) + ";" + CRLF+ ;
"OSCode: "+ TRANSFORM(oError:OsCode, NIL) + ";" + CRLF +;
"SubSystem: " + TRANSFORM(oError:SubSystem, NIL) + ";" +CRLF+ ;
"Message: " + oError:Description )
END
//' Email
TRY
objMsg := CreateObject("CDO.Message")
WITH OBJECT objMsg
:Configuration := msgConf
:From := cFrom
:To := cTo
:Subject := cSubject
// :TextBody := cTextBody
:HTMLBody := "<h1>Hello!</h1><p>This is a test email with an inline image.</p>" + ;
"<p><img src='cid:id_image'></p><p>Best Regards!</p>"
// :HTMLBody := '<h1>HTML Content Here</h1><p>This is a TEST MAIL sent from FiveWin using CDO.</p>';
// + '<img src="" >';
// + '<img src="data:image/jpeg;base64,' + cImgBase64 + '" > ';
// + '<p><b>Test Ende</b></p>' // HTML formatted content
loBP := :AddRelatedBodyPart(cImgPath, "id_image", 1)
WITH OBJECT loBP:Fields
:Item("urn:schemas:mailheader:Content-ID") := "id_image"
:Update()
END WITH
:MDNRequested := .F. // Indicates whether a Message Disposition Notification is requested on a message.
:Send()
END WITH
// objMsg:Send()
lRet := .T.
CATCH oError
MsgInfo("Could not send message" + ";" + CRLF+ ;
"Error: " + TRANSFORM(oError:GenCode, NIL) + ";" + CRLF+;
"SubC: " + TRANSFORM(oError:SubCode, NIL) + ";" + CRLF+ ;
"OSCode: "+ TRANSFORM(oError:OsCode, NIL) + ";" + CRLF +;
"SubSystem: " + TRANSFORM(oError:SubSystem, NIL) + ";" +CRLF+ ;
"Message: " + oError:Description )
RETURN NIL
END
IF lRet // := .T.
? "PERFECT RUTH"
ENDIF
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Send Emails from Fivewin application
Thank you, but this is for SSL, not for TLS, if I'm not wrong.paquitohm wrote:From ChatGPT, simple sample:
Code: Select all | Expand
$SMTP.EnableSsl = $true
Re: Send Emails from Fivewin application
TLS is simply a newer, more secure version of SSL. To use TLS instead of SSL, the servers usually use the port, which can be 587 or 993 or some other
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Send Emails from Fivewin application
Ok, thank you. In the meanwhile, I'm convinced myself (after reading some web pages) that CDO doesn't support TLS.
Re: Send Emails from Fivewin application
Hello,
Although it is not exactly the discussion that is being discussed, it does have to do with sending emails on Fivewin.
I must send an email indicating "Delivery Acknowledgment", I use CDO and I can't find (AI either) how to do it using CDOSYS.
They have told me that it is done with the value "Generate-Delivery-Report" ( https://datatracker.ietf.org/doc/rfc4021/ ) but I can't get it to work.
Would you know how to do it?
Note: do not confuse "Acknowledgment of receipt/reading" with "Acknowledgment of DELIVERY". The first is sent by the recipient as a response, the second is done automatically by the recipient server.
Sorry for using this thread but I've been dealing with this issue for 3 months and I can't get anyone to clarify it for me, and since I've seen that they use CDOSYS here...
Thank you so much,
*****************************************************
Hola,
Aunque no es exactamente la discusión que se está tratando, sí que tiene que ver con el envío de mails en Fivewin.
Debo enviar un mail indicando "Acuse de ENTREGA", yo uso CDO y no encuentro (AI tampoco) como haceerlo usando CDOSYS.
Me han indicado que se hace con el valor "Generate-Delivery-Report" ( https://datatracker.ietf.org/doc/rfc4021/ ) pero no consigo que funcione.
Ustedes sabrían cómo hacerlo?
Nota: no confundan "Acuse de recepción/lectura" con "Acuse de ENTREGA". El primero lo envía el destinatario como respuesta, el segundo lo hace el servidor destinatario de manera automática.
Perdonen que use este hilo pero llevo 3 meses lidiando con este asunto y no consigo que nadie me lo aclare, y como he visto que aquí usan CDOSYS...
Muchas gracias,
Although it is not exactly the discussion that is being discussed, it does have to do with sending emails on Fivewin.
I must send an email indicating "Delivery Acknowledgment", I use CDO and I can't find (AI either) how to do it using CDOSYS.
They have told me that it is done with the value "Generate-Delivery-Report" ( https://datatracker.ietf.org/doc/rfc4021/ ) but I can't get it to work.
Would you know how to do it?
Note: do not confuse "Acknowledgment of receipt/reading" with "Acknowledgment of DELIVERY". The first is sent by the recipient as a response, the second is done automatically by the recipient server.
Sorry for using this thread but I've been dealing with this issue for 3 months and I can't get anyone to clarify it for me, and since I've seen that they use CDOSYS here...
Thank you so much,
*****************************************************
Hola,
Aunque no es exactamente la discusión que se está tratando, sí que tiene que ver con el envío de mails en Fivewin.
Debo enviar un mail indicando "Acuse de ENTREGA", yo uso CDO y no encuentro (AI tampoco) como haceerlo usando CDOSYS.
Me han indicado que se hace con el valor "Generate-Delivery-Report" ( https://datatracker.ietf.org/doc/rfc4021/ ) pero no consigo que funcione.
Ustedes sabrían cómo hacerlo?
Nota: no confundan "Acuse de recepción/lectura" con "Acuse de ENTREGA". El primero lo envía el destinatario como respuesta, el segundo lo hace el servidor destinatario de manera automática.
Perdonen que use este hilo pero llevo 3 meses lidiando con este asunto y no consigo que nadie me lo aclare, y como he visto que aquí usan CDOSYS...
Muchas gracias,
Un Saludo
Carlos G.
FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
Carlos G.
FiveWin 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10