邮件发送问题
MailMessage Message = new MailMessage();
Message.To = "shans.zhao@waysglobal.com ";
Message.From = "shans_ok@163.com ";
Message.Subject = "test mail ";
Message.Body= "null ";
try
{
SmtpMail.SmtpServer = "mail.waysglobal.com ";
SmtpMail.Send(Message);
return true;
}
catch(
System.Web.HttpException ehttp)
{
string err = ehttp.Message;
return false;
}
按照上面的代码,我进行邮件发送时,没有任何问题
但,当我把邮件发送地址(Message.From = "shans_ok@163.com ";)也改为我们公司的邮箱(如:roman.luo@waysglobal.com)时,就会出现错误. 错误提示为:未能访问 "CDO.Message "对象.
请问,我该如何解决,以实现用公司内部的邮箱发送到公司内不的员工邮箱中去.
注意:我们公司的邮箱服务器(mail.waysglobal.com)是服务商提供的.
------解决方案--------------------你看看是不是提供商给的协议不一样的缘故阿?
------解决方案--------------------可能是编码 问题
------解决方案--------------------aspx
--------------------------
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "MyMail.aspx.cs " Inherits= "MyMail " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 无标题页 </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
<div style= "text-align: center ">
<table style= "z-index: 100; left: 233px; width: 530px; position: absolute; top: 55px;
height: 347px ">
<tr>
<td colspan= "2 ">
</td>
</tr>
<tr>
<td style= "width: 100px ">
发送到: </td>
<td style= "width: 100px ">
<asp:TextBox ID= "TxtTo " runat= "server " Style= "position: static " Width= "245px "> </asp:TextBox> </td>
</tr>
<tr>
<td style= "width: 100px ">
来自: </td>
<td style= "width: 100px ">
<asp:TextBox ID= "TxtFrom " runat= "server " Style= "position: static " Width= "243px "> </asp:TextBox> </td>
</tr>
<tr>
<td style= "width: 100px ">
标题: </td>
<td style= "width: 100px ">
<asp:TextBox ID= "TxtTitle " runat= "server " Style= "position: static " Width= "245px "> </asp:TextBox>
</td>
</tr>
<tr>
<td style= "width: 100px ">