curl: can't send email?

Andrew hrdcoding at gmail.com
Mon Jun 10 16:10:07 UTC 2019


What wrong?

```
import std.net.curl;

void main() {
     auto smtp = SMTP("smtps://smtp.gmail.com:465");
     smtp.setAuthentication("qwerty at gmail.com", "password");
     smtp.mailTo = ["<ytrewq at gmail.com"];
     smtp.mailFrom = "<qwerty at gmail.com>";
     smtp.message = "Example Message";
     //smtp.proxy("127.0.0.1:9050");
     smtp.perform();
}
```

std.net.curl.CurlException at std/net/curl.d(4364): Failed sending 
data to the peer on handle 55FACCB58AC0
----------------
??:? pure @safe void 
std.exception.bailOut!(std.net.curl.CurlException).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x55facbd8db5e]
??:? pure @safe bool 
std.exception.enforce!(std.net.curl.CurlException).enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x55facbd8dad1]
??:? void std.net.curl.Curl._check(int) [0x55facbd7209b]
??:? int 
std.net.curl.Curl.perform(std.typecons.Flag!("throwOnError").Flag) [0x55facbd724c7]
??:? int 
std.net.curl.SMTP.perform(std.typecons.Flag!("throwOnError").Flag) [0x55facbd71a80]
??:? _Dmain [0x55facbd69b6b]


More information about the Digitalmars-d-learn mailing list