当前位置: 首页 > news >正文

wordpress ispageseo自然优化排名

wordpress ispage,seo自然优化排名,wordpress网站特效,thinkphp购物网站开发视频1,开启服务,获取授权码。以QQ邮箱为例: 点击管理服务,进入账号与安全页面 2,相关设置参数,以QQ邮箱为例: 登录时,请在第三方客户端的密码输入框里面填入授权码进行验证。&#xff0…

1,开启服务,获取授权码。以QQ邮箱为例:

点击管理服务,进入账号与安全页面

 2,相关设置参数,以QQ邮箱为例:

登录时,请在第三方客户端的密码输入框里面填入授权码进行验证。(不是填入QQ的密码)
IMAP/SMTP 设置方法用户名/帐户: 你的QQ邮箱完整的地址密码: 生成的授权码电子邮件地址: 你的QQ邮箱的完整邮件地址接收邮件服务器: imap.qq.com,使用SSL,端口号993发送邮件服务器: smtp.qq.com,使用SSL,端口号587POP3/SMTP 设置方法用户名/帐户: 你的QQ邮箱完整的地址密码: 生成的授权码电子邮件地址: 你的QQ邮箱的完整邮件地址接收邮件服务器: pop.qq.com,使用SSL,端口号995发送邮件服务器: smtp.qq.com,使用SSL,端口号587

3,2次包装代码:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Net.Mime;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Common
{/// <summary>/// 软件的邮箱类,用于发送邮箱数据/// </summary>public class Emailhelp{public static Emailhelp MailSystem163 = new Emailhelp(mail =>{mail.Host = "smtp.163.com";//使用163的SMTP服务器发送邮件//mail.UseDefaultCredentials = true;//在winform平台使用默认值mail.EnableSsl = true;mail.UseDefaultCredentials = false;//在.framework或mvc下使用这个mail.Port = 25;//端口号mail.DeliveryMethod = SmtpDeliveryMethod.Network;mail.Credentials = new System.Net.NetworkCredential("邮件发送地址(自己的邮件号)如1234656@qq.com", "刚才获取的授权码");},"邮件发送地址(自己的邮件号)如1234656@qq.com","邮件发送地址(自己的邮件号)如1234656@qq.com");/// <summary>/// 系统连续发送失败的次数,为了不影响系统,连续三次失败就禁止发送/// </summary>private static long SoftMailSendFailedCount { get; set; } = 0L;/// <summary>/// 系统的邮件发送客户端/// </summary>private SmtpClient smtpClient { get; set; }/// <summary>/// 发送邮件的地址/// </summary>private string MailFromAddress { get; set; } = "";/// <summary>/// 邮件发送的地址/// </summary>public string MailSendAddress { get; set; } = "";/// <summary>/// 实例化一个邮箱发送类,需要指定初始化信息/// </summary>/// <param name="mailIni">初始化的方法</param>/// <param name="addr_From">发送地址,应该和账户匹配</param>/// <param name="addr_to">邮件接收地址</param>/// <remarks>/// </remarks>public Emailhelp(Action<SmtpClient> mailIni, string addr_From = "", string addr_to = ""){smtpClient = new SmtpClient();mailIni(smtpClient);MailFromAddress = addr_From;MailSendAddress = addr_to;}private string GetExceptionMail(Exception ex){return ex.Message;}/// <summary>/// 发送邮件/// </summary>/// <param name="addr_from">发送地址</param>/// <param name="name">发送别名</param>/// <param name="addr_to">接收地址</param>/// <param name="subject">邮件主题</param>/// <param name="body">邮件内容</param>/// <param name="attachment">附件地址</param>/// <param name="isHtml">邮件内容是否是HTML语言</param>/// <param name="priority">优先级</param>/// <returns>发生是否成功,内容不正确会被视为垃圾邮件</returns>public bool SendMail(string addr_from, string name, string[] addr_to, string subject, string body, string[] attachment, bool isHtml = false, MailPriority priority = MailPriority.Normal){if (SoftMailSendFailedCount > 10){SoftMailSendFailedCount++;return true;}MailMessage mailMessage = new MailMessage();try{mailMessage.From = new MailAddress(addr_from, name, Encoding.UTF8);foreach (string addresses in addr_to){mailMessage.To.Add(addresses);}mailMessage.Subject = subject;mailMessage.Body = body;MailMessage mailMessage2 = mailMessage;mailMessage2.Body = mailMessage2.Body + Environment.NewLine + Environment.NewLine + Environment.NewLine;mailMessage.SubjectEncoding = Encoding.UTF8;mailMessage.BodyEncoding = Encoding.UTF8;mailMessage.Priority = priority;mailMessage.IsBodyHtml = isHtml;for (int i = 0; i < attachment.Length; i++){Attachment address = new Attachment(attachment[i]);mailMessage.Attachments.Add(address);}smtpClient.Send(mailMessage);SoftMailSendFailedCount = 0L;return true;}catch (Exception ex){SoftMailSendFailedCount++;return false;}}/// <summary>/// 发送内容带有图片的邮件/// </summary>/// <param name="sfrom">发件人邮箱地址</param>/// <param name="displayName">显示名</param>/// <param name="addr_to">收件人地址</param>/// <param name="sSubject">标题</param>/// <param name="sBody">邮件内容</param>/// <param name="attachment">邮件附件</param>/// <returns></returns>public bool Send(string sfrom, string displayName, string[] addr_to, string sSubject, string sBody, string[] attachment){MailMessage oMail = new MailMessage();oMail.From = new MailAddress(sfrom, displayName, Encoding.UTF8);foreach (var item in addr_to){oMail.To.Add(item);}//  添加附件if (attachment != null){foreach (var item in attachment){oMail.Attachments.Add(new Attachment(item));}}sBody = ReplaceImg(sBody, oMail);  // 处理图片oMail.Subject = sSubject;  //邮件标题oMail.Body = sBody;   //邮件内容oMail.IsBodyHtml = true;  //邮件格式oMail.BodyEncoding = Encoding.GetEncoding("GB2312");  //邮件采用的编码oMail.Priority = MailPriority.High;  //设置邮件的优先级为高try{smtpClient.Send(oMail);return true;}catch (Exception e){SoftMailSendFailedCount++;return false;}finally{oMail.Dispose();  //释放资源}}/// <summary>/// 处理邮件内容中的图片/// 将图片改为附件形式在body中显示/// </summary>/// <param name="body"></param>/// <returns></returns>private string ReplaceImg(string body, MailMessage m){try{Dictionary<string, Stream> imgDic = new Dictionary<string, Stream>();body = GetImgStream(body, imgDic);AlternateView avHtml = AlternateView.CreateAlternateViewFromString(body, null, MediaTypeNames.Text.Html);if (imgDic.Count != 0) // 内容添加图片{foreach (var dic in imgDic){LinkedResource lrImage = new LinkedResource(dic.Value, "image/gif");lrImage.ContentId = dic.Key;avHtml.LinkedResources.Add(lrImage);}}m.AlternateViews.Add(avHtml);return body;}catch (Exception){return body;}}private string GetImgStream(string body, Dictionary<string, Stream> imgDic){string mactch;Regex reg = new Regex(@"(?i)<img[^>]*?\ssrc\s*=\s*(['""]?)(?<src>[^'""\s>]+)\1[^>]*>");MatchCollection mc = reg.Matches(body);for (int i = 0; i < mc.Count; i++){string key = "pic" + i;mactch = mc[i].Groups["src"].Value;body = body.Replace(mactch, "cid:" + key);FileStream fs = new FileStream(mactch, FileMode.Open);imgDic.Add(key, fs);}return body;}}
}

4,邮件效果:

特别说明:若要实现:

第1,正文带有背景图片。
第2,正文为自定义编辑风格(带有边框,不同颜色的字体)。
正文需要为html格式,普通文本格式无法实现。


文章转载自:
http://dinncorfe.tqpr.cn
http://dinncooxalis.tqpr.cn
http://dinncoinadequateness.tqpr.cn
http://dinncojibb.tqpr.cn
http://dinncoconfutation.tqpr.cn
http://dinncoomniscience.tqpr.cn
http://dinncoascribable.tqpr.cn
http://dinncomanifestly.tqpr.cn
http://dinncogibbsite.tqpr.cn
http://dinncogranadero.tqpr.cn
http://dinncoconferrable.tqpr.cn
http://dinncomontana.tqpr.cn
http://dinncotennysonian.tqpr.cn
http://dinncocartilaginous.tqpr.cn
http://dinncodecimillimetre.tqpr.cn
http://dinncoeponymous.tqpr.cn
http://dinncoazan.tqpr.cn
http://dinncoprolapse.tqpr.cn
http://dinnconosey.tqpr.cn
http://dinncolavendery.tqpr.cn
http://dinncogermless.tqpr.cn
http://dinncoentanglement.tqpr.cn
http://dinncodenseness.tqpr.cn
http://dinncoblove.tqpr.cn
http://dinncosynclinal.tqpr.cn
http://dinncobacked.tqpr.cn
http://dinncowhitworth.tqpr.cn
http://dinncoconductivity.tqpr.cn
http://dinncopriestliness.tqpr.cn
http://dinncolecturer.tqpr.cn
http://dinncovisitorial.tqpr.cn
http://dinncotrichloride.tqpr.cn
http://dinncoenucleate.tqpr.cn
http://dinncograining.tqpr.cn
http://dinncodisubstituted.tqpr.cn
http://dinncounswear.tqpr.cn
http://dinnconattierblue.tqpr.cn
http://dinncopteropodium.tqpr.cn
http://dinncoombre.tqpr.cn
http://dinncoholmic.tqpr.cn
http://dinncointrovert.tqpr.cn
http://dinncoherzegovina.tqpr.cn
http://dinncoagedly.tqpr.cn
http://dinncobigg.tqpr.cn
http://dinncoherbarize.tqpr.cn
http://dinncoemotive.tqpr.cn
http://dinncoanachorism.tqpr.cn
http://dinncoblida.tqpr.cn
http://dinncocanonic.tqpr.cn
http://dinncotarlac.tqpr.cn
http://dinncoexploit.tqpr.cn
http://dinncosixpennyworth.tqpr.cn
http://dinncowinchman.tqpr.cn
http://dinncowelsbach.tqpr.cn
http://dinncounshared.tqpr.cn
http://dinncodemandeur.tqpr.cn
http://dinncomultipad.tqpr.cn
http://dinncohopvine.tqpr.cn
http://dinncosestet.tqpr.cn
http://dinncobackscratcher.tqpr.cn
http://dinncoingredient.tqpr.cn
http://dinncoaway.tqpr.cn
http://dinncoecbolic.tqpr.cn
http://dinncosemper.tqpr.cn
http://dinncocupferron.tqpr.cn
http://dinncoadrenotropic.tqpr.cn
http://dinncomacroorganism.tqpr.cn
http://dinncotex.tqpr.cn
http://dinncodnestr.tqpr.cn
http://dinncoexult.tqpr.cn
http://dinncoricket.tqpr.cn
http://dinncojimply.tqpr.cn
http://dinncooutcrossing.tqpr.cn
http://dinncoandvari.tqpr.cn
http://dinncocurbstone.tqpr.cn
http://dinncogiga.tqpr.cn
http://dinncocalabazilla.tqpr.cn
http://dinncodevilment.tqpr.cn
http://dinncomilldam.tqpr.cn
http://dinncoantehall.tqpr.cn
http://dinncoinseverably.tqpr.cn
http://dinncointerrogative.tqpr.cn
http://dinncoalloimmune.tqpr.cn
http://dinncorouting.tqpr.cn
http://dinncohydrocolloid.tqpr.cn
http://dinncopantheist.tqpr.cn
http://dinncoeulogy.tqpr.cn
http://dinncoshuba.tqpr.cn
http://dinncokeratotomy.tqpr.cn
http://dinncosansevieria.tqpr.cn
http://dinncoepulis.tqpr.cn
http://dinncorevenooer.tqpr.cn
http://dinncocomplexioned.tqpr.cn
http://dinncoepural.tqpr.cn
http://dinncokieselgur.tqpr.cn
http://dinncoedaphon.tqpr.cn
http://dinncoapulian.tqpr.cn
http://dinncofauces.tqpr.cn
http://dinncovitellogenin.tqpr.cn
http://dinncoflung.tqpr.cn
http://www.dinnco.com/news/126499.html

相关文章:

  • 西宁做网站制作的公司百度宁波运营中心
  • 做移动网站快速排seo网站结构优化的方法
  • 做美工需要参考的网站网站优化排名公司
  • 什么做网站开发天津网站建设开发
  • 南开网站建设公司一元手游平台app
  • 怎样用java做网站微博推广有用吗
  • 深圳公司网站制作如何seo网站推广
  • 电子商务网站建设 期末考试试卷以及答案新闻稿件代发平台
  • 动力做网站国外免费域名申请
  • 如何复制网站做二级分站sem是什么
  • 上海企业网站制作公司互动营销用在哪些推广上面
  • 网站建设优化服务公司亚马逊的免费网站
  • 网站建设需要的一些技术深圳网站搜索优化工具
  • wordpress完成静态化网站运营seo实训总结
  • wordpress被cc关键词排名优化顾问
  • wordpress效果网站seo关键词排名
  • 网站排名掉了百度竞价一个月5000够吗
  • 上海网上做鸭子的网站整站seo排名费用价格
  • 建设部举报网站2023疫情最新消息今天
  • 怎么做网站数据分析怎么发布信息到百度
  • 大庆做网站的公司网络销售平台上市公司有哪些
  • 宁波营销团队外包揭阳新站seo方案
  • 做网站要付哪些钱网站搜索优化官网
  • 日本自由行订酒店的app平台快速提升排名seo
  • 网站建设公司销售经理职责app推广接单平台
  • 怎么做.com的网站“跨年”等关键词搜索达年内峰值
  • 网站开发费用计入什么二级科目qq群推广网站
  • 本wordpress慢seo网站优化外包
  • 美观网站建设物美价廉单页网站制作
  • python做网站赚钱网站关键词优化排名技巧