Send email: Difference between revisions

Content added Content deleted
(Added zkl)
(Updated D entry)
Line 256: Line 256:
=={{header|D}}==
=={{header|D}}==
Requires the libcurl library to be installed on the system.
Requires the libcurl library to be installed on the system.
<lang d>import std.net.curl;
<lang d>void main() {
import std.net.curl;


auto s = SMTP("smtps://s.gmail.com");
void main() {
auto smtp = SMTP("smtps://smtp.gmail.com");
s.setAuthentication("someuser@gmail.com", "somepassword");
s.mailTo = ["<friend@example.com>"];
smtp.setAuthentication("someuser@gmail.com", "somepassword");
smtp.mailTo = ["<friend@example.com>"];
s.mailFrom = "<someuser@gmail.com>";
smtp.mailFrom = "<someuser@gmail.com>";
s.message = "Subject:test\n\nExample Message";
s.perform;
smtp.message = "Subject:test\n\nExample Message";
smtp.perform();
}</lang>
}</lang>