Welcome! Log In Create A New Profile

Advanced

WD23 - Email Sending problem

Posted by SwissStephan 
WD23 - Email Sending problem
March 26, 2019 06:56PM
Hi to all
Just bought newest version of WinDev to get rid of an error I have since WD15 but Nothing has changed.
If I use the WDMAIL example, defining an account works perfect (see Picture) but when I want to send a mail out of this application I ceceive the following error:
SMTP Session: connection failed. No server response.
Reception failed: problem reading on socket.
System error returned by socket:
<Connection reset by the other side (WSAECONNRESET)>

Sorry but I don't have any idea where and what I have to correct.
Any help, please?
Kind regards from Switzerland
Stephan
Attachments:
open | download - WD23.png (52.3 KB)
Re: WD23 - Email Sending problem
March 26, 2019 07:20PM
Hi Stephan,

myself I'm sending mails through our SMTP server effortlessly. Message says that you cannot connect to your smtp server. Is it your own e-Mail-Server on your server or is it a server available to the general public?

Kind regards,
Guenter Predl
office@windev.at
Re: WD23 - Email Sending problem
March 26, 2019 10:07PM
Hi
@bluewin.ch is a General public Server from Swisscom, the biggest telecommunication Company in Switzerland
I compared the entered values with my values in Outlook365 and they are equal.
What I find strange is, that validation on the account screen in example WDMAIL is successful, but the same application can't send a mail...
Kind regards
Stephan
Al
Re: WD23 - Email Sending problem
March 26, 2019 10:21PM
Hello Stephen,

It's a fact of life that PCSoft's examples are not the best in terms of function, designs or any other real world criteria.
I think the reason for this is that they see them primarily as teaching examples to illustrate features, but they have very little real world experience.

The smtp functions work well.
My advice is to start from scratch, in procedural code.
Use the email structure variable, fill it with the appropriate data and then the EmailStartSMTPSession function will do the rest.

Regards
Al
Re: WD23 - Email Sending problem
March 27, 2019 08:49AM
Hi Stephan,

the image says that the connection tio the outgoing server was successful, which says = OK. So, what's the problem now?

Kind regards,
Guenter Predl
office@windev.at
pao
Re: WD23 - Email Sending problem
March 27, 2019 10:23AM
Stephan,
Can you please show us your code to send the email?

In the picture we can see some of the IMAP (receiving email) parameters but we can't see anything about the SMTP (sending email).

Working sample code to send emails using the hotmail SMTP server:
IF NOT EmailStartSMTPSession("my_account@hotmail.com","my_password", "smtp.live.com",25,False,emailOptionSecuredTLS) THEN
Error("error in startsmtp",ErrorInfo())
RETURN
END

EmailReset()

Email.Sender = "my_account@hotmail.com"
Email.NbRecipient = 1

Email.Recipient[1] = "destination_email@dest_domain.com"


Email.Subject = "test sending email email"
Email.Message="Teste Test Test"

IF NOT EmailSendMessage("my_account@hotmail.com") THEN
Error("error in send",ErrorInfo())
END
EmailCloseSession("my_account@hotmail.com")



I can't help you with the real server because Swisscom doesn't allow me to create one account, message from Swisscom:
Unfortunately, it is not permitted to register for Swisscom from outside Switzerland.

Regards

Paulo Oliveira



Edited 4 time(s). Last edit at 03/27/2019 03:29PM by pao.
Re: WD23 - Email Sending problem
March 27, 2019 04:56PM
Hi Stephan

check your config wiht the help of this link

[www.swisscom.ch]

we work with bluewin since years ( but using SMTP not IMAP)

regards, Heinz
pao
Re: WD23 - Email Sending problem
March 27, 2019 06:20PM
Probably you are using EmailStartSession instead of EmailStartPOP3Session and EmailStartSMTPSession

check the Authenticated SMTP in this help page: [doc.windev.com]

Regards

Paulo Oliveira
Re: WD23 - Email Sending problem
March 27, 2019 10:38PM
Hi guys
Thanks for all your help!
@gpredl The Problem is, that the EXAMPLE WDMAIL tells me, that all settings are correct (image), but when I want to send an email with the same application, I receive this error message.
@Heinz Config is 100% like this one in your link and 100% identical with my Outlook365 settings.
@AL My own code worked until WD12. With WD15 it stopped working. At moment I'm updating my Project from 15 to 23. Since I still have hundreds of Errors, I just wanted to test my biggest issue with the WDExample receiving the strange behaviour.
@PAO I can't tell you at moment which EmailStart the Example uses. The example is programmed in object oriented mode (I programmed the last 40 years procedurally) and I really can't debug it properly at moment.
Have a great evening Stephan
Re: WD23 - Email Sending problem
March 29, 2019 10:49AM
Just wrote a simple program like suggested.
Everything works fine!
Thx, Guys!
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: