社区
C#
帖子详情
sending mail
lude8880
2008-12-08 10:28:37
我自己搭了一个email server,里面的地址只能自己互相传,怎么用c#编一个程序,让一个用户收到mail后自动转发给真实的mailadress啊
...全文
112
4
打赏
收藏
sending mail
我自己搭了一个email server,里面的地址只能自己互相传,怎么用c#编一个程序,让一个用户收到mail后自动转发给真实的mailadress啊
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Tiger_ldy
2008-12-08
打赏
举报
回复
学习了啊
j45kp
2008-12-08
打赏
举报
回复
public class SipMail
{
private static CDO.MessageClass mailExchange;
private static CDO.MessageClass MailExchange
{
get
{
if (null == mailExchange)
{
mailExchange = new CDO.MessageClass();
ADODB.Fields oFields = mailExchange.Configuration.Fields;
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"].Value = 2;
oFields["http://schemas.microsoft.com/cdo/configuration/sendmailaddress"].Value = "sip@asus.com.tw";//mail from
oFields["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"].Value = "smtp@csc.asus.com.tw";
oFields["http://schemas.microsoft.com/cdo/configuration/sendusername"].Value = "smtp"; //mail server account
oFields["http://schemas.microsoft.com/cdo/configuration/sendpassword"].Value = "asus0302"; //mail server password
oFields["http://schemas.microsoft.com/cdo/configuration/languagecode"].Value = 0x0804;
oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].Value = 1;
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"].Value = "csc.asus.com.tw"; //mail server"192.168.88.15"
mailExchange.From = "SIP<sip@asus.com.tw>";
}
return mailExchange;
}
}
public SipMail()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public static bool SendMail(string receiver, string subject, string content)
{
bool result = true;
try
{
MailExchange.To = receiver;
MailExchange.Subject = subject;
MailExchange.HTMLBody = content;
MailExchange.Configuration.Fields.Update();
mailExchange.HTMLBodyPart.Charset = "unicode-1-1-utf-8";
mailExchange.TextBodyPart.Charset = "unicode-1-1-utf-8";
MailExchange.Send();
}
catch
{
result = false;
}
finally
{
}
return result;
}
}
SipMail.SendMail("xxx@sina.com", "标题“,内容);
Red_Stone
2008-12-08
打赏
举报
回复
调用email server的接口就可以了啊。
hawaiiboys
2008-12-08
打赏
举报
回复
顶下
C# 服务器发送邮件失败实例分析
错误展示: 我在本地是可以发送的但部署到服务器上后就不能发送了。SMTP服务是开了的。 报错: “{“success”:false,”message”:”错误System.Net.
Mail
.SmtpException: Failure
send
ing
mail
. —> System.Net.WebException: The remote name could not be resolved: ‘smtp.163.com’ 分析: 邮件发送相关端口 首先说下邮件发送的端口:25/465/587 25端口 25端口是为SMTP协议服务开放的,是这三个端口中最老的一个。25端口也称为消息中继端
Send
ing
Mail
:创建该项目是为了提高我使用Java
Mail
库发送电子邮件的知识
Send
ing
Mail
:创建该项目是为了提高我使用Java
Mail
库发送电子邮件的知识
JAVA-
mail
-API.zip_Attachments
Send
ing
mail
with attachments automatically
J2EE add-on for
send
ing
mail
(SMTP)-开源
J2EE
MAIL
,Java 2 Entreprise Edition插件(J2EE),用于发送电子邮件(SMTP)。
javax.
mail
.
Send
FailedException:
Send
ing
failed问题原因
主要介绍了javax.
mail
.
Send
FailedException:
Send
ing
failed问题原因,需要的朋友可以参考下
C#
110,535
社区成员
642,577
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章