我已经在asp中编写了代码,用于向我的客户发送电子邮件。我正在使用带有iis5.1的Windows XP,这当然是过时的,cdo.message和smtp.gmail.com。一切都很顺利。生成并发送电子邮件。但我发现,当电子邮件发送到雅虎和其他邮件服务器时,它不会显示在Gmail帐户中。有人可以帮我把邮件发送到“xxxxx@gmail.com”吗?
foreach (DataRow row in ds.Tables[0].Rows)
{
// Now here, you are iterating through a individual row.
// ItemArray gives an index position of a cell within a row.
m.Text = row.ItemArray[0].ToString();
i.Text = row.ItemArray[1].ToString();
d.Text = row.ItemArray[2].ToString();
g.Text = row.ItemArray[3].ToString();
}
Set objMsg = CreateObject("CDO.Message")
谢谢和问候,
Jojy
答案 0 :(得分:0)
尝试以下代码:
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.gmail.com"
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="username@gmail.com"
objMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="Password"