Send email: Difference between revisions

(→‎{{header|D}}: added D)
Line 224:
 
This version does not do authentication. However, the login() method can accept a username and password for authentication. Also, newer versions of POCO provide SecureSMTPClientSession, for doing STARTTLS.
 
=={{header|D}}==
Requires the libcurl library to be installed on the system.
<lang d>import std.net.curl;
 
void main() {
auto smtp = SMTP("smtps://smtp.gmail.com");
smtp.setAuthentication("someuser@gmail.com", "somepassword");
smtp.mailTo = ["<friend@example.com>"];
smtp.mailFrom = "<someuser@gmail.com>";
smtp.message = "Subject:test\n\nExample Message";
smtp.perform();
}</lang>
 
=={{header|Delphi}}==
Anonymous user