Petrov Dmytro
-
Posts
17 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Petrov Dmytro
-
-
3 hours ago, FRANCISCO CASTRO SOTO said:
Hello, I am trying to send emails from a gmail email account, and doing everything on my computer, if I generate a CGI it sends perfectly but if I generate ISAPI and under IIS it does nothing, it does not generate logs or anything like that, it simply does not do nothing, I have the libraries in the execution folder of both the ISAPI and the CGI, and I don't know how to send Gmail email from ISAPI, can someone help me, thank you.
You need to enable less secure apps: https://apps.google.com/supportwidget/articlehome?hl=en&article_url=https%3A%2F%2Fsupport.google.com%2Fa%2Fanswer%2F6260879%3Fhl%3Den&assistant_id=generic-unu&product_context=6260879&product_name=UnuFlow&trigger_context=a
Here is my code to send Emails from any mail server, including Gmail:
Var IdSMTP: TIdSMTP; IdMessage1: TIdMessage; IdSSLIOHandlerSocketOpenSSL: TIdSSLIOHandlerSocketOpenSSL; begin IdMessage1 := TIdMessage.Create; IdMessage1.From.Address := MailFromAddress; IdMessage1.Recipients.Add.Address := Email; IdMessage1.Subject := MailTitle; IdMessage1.Body.Add(MailText); IdMessage1.Date:= now; IdMessage1.ContentType := MailContentType; IdMessage1.CharSet := MailCharSet; IdSMTP := TIdSMTP.Create(nil); IdSMTP.Host := MailSMTPHost; IdSMTP.Port := MailSMTPPort; IdSMTP.Username := MailUsername; IdSMTP.Password := MailPassword; if MailSMTPAuthType = 0 then IdSMTP.AuthType := satDefault; if MailSMTPAuthType = 1 then IdSMTP.AuthType := satNone; if MailSMTPAuthType = 2 then IdSMTP.AuthType := satSASL; // SSL IdSSLIOHandlerSocketOpenSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil); IdSSLIOHandlerSocketOpenSSL.Destination := IdSMTP.Host+':'+IntToStr(IdSMTP.Port); IdSSLIOHandlerSocketOpenSSL.Host := IdSMTP.Host; IdSSLIOHandlerSocketOpenSSL.Port := IdSMTP.Port; IdSSLIOHandlerSocketOpenSSL.DefaultPort := MailOpenSSLDefaultPort; if MailSSLMode = 0 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Mode := sslmUnassigned; if MailSSLMode = 1 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Mode := sslmClient; if MailSSLMode = 2 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Mode := sslmServer; if MailSSLMode = 3 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Mode := sslmBoth; IdSMTP.IOHandler := idSSLIOHandlerSocketOpenSSL; if MailSSLMethod = 0 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Method := sslvSSLv23; if MailSSLMethod = 1 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Method := sslvTLSv1; if MailSSLMethod = 2 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Method := sslvTLSv1_1; if MailSSLMethod = 3 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Method := sslvTLSv1_2; if MailSSLMethod = 4 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Method := sslvSSLv2; if MailSSLMethod = 5 then IdSSLIOHandlerSocketOpenSSL.SSLOptions.Method := sslvSSLv3; if MailUseTLS = 0 then IdSMTP.UseTLS := utUseImplicitTLS; if MailUseTLS = 1 then IdSMTP.UseTLS := utNoTLSSupport; if MailUseTLS = 2 then IdSMTP.UseTLS := utUseRequireTLS; if MailUseTLS = 3 then IdSMTP.UseTLS := utUseExplicitTLS; try try IdSMTP.Connect; except on E: Exception do Begin End; end; IdSMTP.Send(IdMessage1); finally IdSMTP.Disconnect; idMessage1.Free; IdSSLIOHandlerSocketOpenSSL.Free; idSMTP.Free; end; end;
-
ZhangLazarus, sorry, I don't understand, what does this mean? UniGUI can be installed on Lazarus? Or you somehow modified it to install? Or are you selling your custom solution to install UniGUI to Lazarus?
On 11/13/2023 at 11:12 AM, ZhangLazarus said:copyright by QQ:48391810
- 1
-
2 hours ago, Sherzod said:
Yeah, but the manual is pretty vague about it
QuoteIn theory, uniGUI is able to resize screen elements back to their original sizes when you run the application, but there can be scenarios where this may not work as expected
That's why I am interested if in my scenario there are going to be any problems?
---------------------
Просто в 4K всё очень мелкое, а если поставить коэффициент х2 и больше его не трогать, то ведь не должно быть проблем с пересчётом масштабирования? Да, некоторые шрифты становятся либо слишком крупные или мелкие, но ведь это всё можно поправить в свойствах компонентов и, по идее, если больше не менять коэффициент, то проблем быть не должно. Или я чего-то не учитываю? -
I read a manual about limitations using High DPI (>96 PPI) and scaling of UniGui applications. But I have one question:
If I manually set PPI to a x2 scaling in IDE (192 PPI) and then modify font sizes and other parameters to look OK and then will never open this project on other PCs with different PPI, will I get any problems in the future? -
Спасибо! Это сработало идеально.
- 1
-
Сделал тест. Версия 1565.
-
Я пытаюсь сделать настраиваемую пользователем таблицу на базе TUniStringGrid
В случае, если пользователь скрывает колонку я делаю ширину равную 0.
List.Columns[1].Width := 0
При этом размер заголовка колонки становится невидимым, но содержание всёравно имеет определённую ширину, что сдвигает контент и приводит к образованию вертикальных линий. Это можно как-то исправить?
Использую последнюю версию UniGui
-
Это сработало, спасибо!
-
На форме стоит свойство AlignmentControl = uniAlignmentClient
Если при создании таблицы установить ширину колонки, например, в 300 пикселей, а потом пользователь в RunTime изменит это значение (растянет мышкой), то при запросе из кода мы по-прежнему получим значение 300.
UniStringGrid.Columns[1].Width
А я хочу реализовать сохранение ширины колонки в Cookie для удобства пользователя. Как мне получить реальное значение ширины колонки?
-
You can do it like this (code for LoginFrm). Insert here --> LoginFrm.Script
function doOnResizeChange() { if (typeof LoginFrm !== 'undefined') { var winWidth = window.innerWidth, winHeight = window.innerHeight; LoginFrm.window.setPosition(0, 0); LoginFrm.window.setSize(winWidth, winHeight); } } function doOnOrientationChange() { setTimeout(doOnResizeChange, 1000); } window.addEventListener('orientationchange', doOnOrientationChange); window.addEventListener('resize', doOnResizeChange); setTimeout(doOnResizeChange, 10);
Sending mail from Gmail
in Deployment
Posted
Are you sure you enabled less secure apps for Gmail?
SSL is essential, I use WACS to get Let's Encrypt certificates.
Also, access your service via HTTPS protocol to send Email.
It worked for me. But generally I found Gmail SMTP to be unreliable and currently using other service. And this Fall Gmail will block password-based programmatic sign-ins. So consider using other SMTP service for sending emails.