, 28 2011 . 12:36
+
Windows Azure . , - . , , - .
, 1) 2) Exchange .
, , SSL 587 . ,
Copy Source | Copy HTML- var client = new SmtpClient(props["SmtpServer"])
- {
- DeliveryMethod = SmtpDeliveryMethod.Network,
- Credentials = new NetworkCredential(props["SmtpLogin"], props["SmtpPwd"]),
- Port = int.Parse(props["SmtpPort"]),
- EnableSsl = true,
- };
-
- what = what + @"
, " + props["HostAddress"];
-
- try
- {
- #if !DEBUG
- client.Send(props["SmtpLogin"],
- to,
- "Subj",
- string.Format(what, pars));
- #endif
- }
- catch (SmtpFailedRecipientsException)
- {
-
- }
Copy Source | Copy HTML- <add key="SmtpServer" value="smtp.gmail.com" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
- <add key="SmtpLogin" value="mail@gmail.com" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
- <add key="SmtpPwd" value="password" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
- <add key="SmtpPort" value="587" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
, , native -
PS: Azure .
:
code
microsoft
azure