<![CDATA[Messages posted by "thien0291"]]> /hvaonline/posts/listByUser/261469.html JForum - http://www.jforum.net Lớp học Hacking - Scriptkiddies class /hvaonline/posts/preList/45425/279575.html#279575 /hvaonline/posts/preList/45425/279575.html#279575 GMT Xin hỏi về code send mail? Code:
public void SendEmail(string subject, string body)
        {
            var fromAddress = new MailAddress("username@gmail", "From Name");
            var toAddress = new MailAddress("Receiver@abc.xyz", "To Name");
            const string fromPassword = "Password";


            var smtp = new SmtpClient
            {
                Host = "smtp.gmail.com", // cái này sử dụng cho gmail ... thay server khác nếu muốn
                Port = 587,
                EnableSsl = true,
                DeliveryMethod = SmtpDeliveryMethod.Network,
                Credentials = new NetworkCredential(fromAddress.Address, fromPassword),
                Timeout = 200000
            };
            using (var message = new System.Net.Mail.MailMessage(fromAddress, toAddress)
            {
                Subject = subject,
                Body = body
            })
            {
                smtp.Send(message);
            }
        }
]]>
/hvaonline/posts/preList/41839/262538.html#262538 /hvaonline/posts/preList/41839/262538.html#262538 GMT