mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
24 lines
494 B
C++
24 lines
494 B
C++
#include <Core/SMTP/SMTP.h>
|
|
|
|
using namespace Upp;
|
|
|
|
// This example requires OpenSSL library installed in win32!
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
Smtp::Trace();
|
|
String to = "to@test";
|
|
String user = "test";
|
|
String pwd = "test";
|
|
Smtp mail;
|
|
mail.Host("smtp.gmail.com")
|
|
.Port(465)
|
|
.SSL()
|
|
.Auth(user, pwd)
|
|
.AddHeader("Test", String().Cat() << "<ua.aa>")
|
|
.AddHeader("Message-ID", String().Cat() << "<ua.aa>")
|
|
.To(to)
|
|
.Subject("Test message")
|
|
.Body("Hello world!")
|
|
.Send();
|
|
}
|