我现在要实现一个将图片发送到email的功能
首先是想问问哪位有关于祝福生日快乐的图片。
越多越好。
再次想请教怎样将图片发送到email。
如果不作为附件发送使图片像文本内容一样直接在email里显示可以么?
哪位有代码或是方法。
急。谢谢了。
发送邮件的我以前没做过。
现在是调用别人的方法,只是可以发送文本内容的。
发送图片的可以在我这个方法基础上更改么?
下面是我调用别人的方法的代码。请高手帮帮忙。非常非常非常感谢啦!*^-^*public static bool SendEmail(string hidMailFrom,string hidMailTo,string strMailMessage,string strSubject)
{
try
{
MailMessage mail=new MailMessage();
mail.From = "[email protected]";
mail.To = hidMailTo;
mail.Subject = strSubject;
mail.Body=strMailMessage;
mail.BodyEncoding = Encoding.Default;
mail.BodyFormat = MailFormat.Html;
mail.Priority = MailPriority.High;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "HRmessenger"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "hr123456"); //set your password here
SmtpMail.SmtpServer = "mail.aurora.com.cn"; //your real server goes here SmtpMail.Send( mail );
return true;
}
catch{return false;}
}
首先是想问问哪位有关于祝福生日快乐的图片。
越多越好。
再次想请教怎样将图片发送到email。
如果不作为附件发送使图片像文本内容一样直接在email里显示可以么?
哪位有代码或是方法。
急。谢谢了。
发送邮件的我以前没做过。
现在是调用别人的方法,只是可以发送文本内容的。
发送图片的可以在我这个方法基础上更改么?
下面是我调用别人的方法的代码。请高手帮帮忙。非常非常非常感谢啦!*^-^*public static bool SendEmail(string hidMailFrom,string hidMailTo,string strMailMessage,string strSubject)
{
try
{
MailMessage mail=new MailMessage();
mail.From = "[email protected]";
mail.To = hidMailTo;
mail.Subject = strSubject;
mail.Body=strMailMessage;
mail.BodyEncoding = Encoding.Default;
mail.BodyFormat = MailFormat.Html;
mail.Priority = MailPriority.High;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "HRmessenger"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "hr123456"); //set your password here
SmtpMail.SmtpServer = "mail.aurora.com.cn"; //your real server goes here SmtpMail.Send( mail );
return true;
}
catch{return false;}
}
解决方案 »
- GridView 分页问题
- webservice的应用
- 如何实现ASPX页中.一部分的内容会刷新,一部分不会刷新...
- 为什么我这个正则表达式不能检查出空格?
- machine.config is missing 错误,求帮助
- 在web form中用treeview动态生成树后......?????
- 怎么在asp.net中插入flash,请高手帮忙,在线等
- 这个问题很有挑战性,大家一起讨论一下,每页显示一条记录的最佳实现方法,谢谢大家
- gridview中pagersettings的位置问题
- 询问一个ASP.NET项目的报价(涉及全文检索和网站信息获取)
- ==========请教treeview的超链接问题谢谢!=====================
- ●●★※repeater控件的问题★●●※
这个strMailMessage写成这样的格式
strMailMessage="<html><head><title>test</title></head>";
strMailMessage+=<body><img src="test.gif"/></body></html>"
邮件的编码方式,如果我记得没错的话应该是:UUnicode