NpsSmtp class

NpsSmtp用于发送电子邮件。以下样例代码演示了发送带附件的HTML邮件。

var f = new NpsFile('test.txt');
f.OpenWriter(false);
f.WriteString('hello from npsfile');
f.Close();

var client = new NpsSmtp("smtp.gmail.com",25);
client.Connect("xjwebstar@gmail.com","mypassword");
client.SetCharset('UTF-8');
client.SetFrom('xjwebstar@gmail.com');
client.AddTo('jialin@jwebstar.com');
client.AddCc('support@jwebstar.com');
client.AddBcc('service@jwebstar.com');
client.SetSubject('test from npsemail');
client.SetHtmlMsg('<font color=red>hello from npsemail</font>');
client.AddAttach(f);
client.Send();
top

Method Summary