在编写发送电子邮件的代码时,为什么... httpClient是否足以将电子邮件发送到gmail服务器? [英] In writing code to send an email why...Is httpClient enough for sending an email to a gmail server?

查看:73
本文介绍了在编写发送电子邮件的代码时,为什么... httpClient是否足以将电子邮件发送到gmail服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在编写代码发送电子邮件时,为什么需要 localhost .
我们可以通过应用发送电子邮件吗?不能在localhost上运行.httpClient是否足以将电子邮件发送到gmail服务器?

Hi,
In writing code to send an email why there is a need of localhost .
Can we send email from an app. does not running on localhost.Is httpClient enough for sending an email to a gmail server?

推荐答案

您不希望使用localhost-您可以在中指定电子邮件发件人代码非常容易.但是您不能使用HttpClient-您需要改为与SMTP通讯.这里有一个通用的例程:发送电子邮件在C#中(带有或不带有附件):通用例程. [
You don''t nend localhost - you can specify the email sender in the code very easily. You can''t use HttpClient though - you need to talk to SMTP instead. There is a generic routine for it here: Sending an Email in C# with or without attachments: generic routine.[^]


这篇关于在编写发送电子邮件的代码时,为什么... httpClient是否足以将电子邮件发送到gmail服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆