我想了解通过Infusionsoft电子邮件服务提供商发送电子邮件的更好过程。
例如,我在互联网上找到了这段代码,该代码展示了通过PHP发送电子邮件的示例:
<?php
echo "Hello World! <br/>";
include_once('iSDK/src/isdk.php');
//require_once"iSDK/src/isdk.php";
$myApp = new iSDK();
// Test Connnection
if ($myApp->cfgCon("connectionName"))
{
echo "Connected...";
}
else
{
echo "Not Connected...";
}
$myApp->sendEmail('conList','marif252@gmail.com','arif.liaqat@yahoo.com', 'ccAddresses', 'bccAddresses', 'contentType', 'subject', 'htmlBody', 'txtBody');
?>
但是,我无法在C#上找到任何东西……在此之前,还有其他人可以使用它吗?可以给我看一个有关如何完成此操作的示例吗?
答案 0 :(得分:0)
我一直在使用以下代码
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress("youremail", "your title", System.Text.Encoding.UTF8);
Msg.To.Add("sendingemailadres");
Msg.Subject = "Your Password Details";
Msg.Body = "your message";
Msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
smtp.Port = 587;
smtp.EnableSsl = true;
smtp.Credentials = new NetworkCredential("youremail(it can be gmail)", "your email's password");
smtp.Send(Msg);