JavaShuo
欄目
標籤
郵件發送
時間 2021-08-13
標籤
shell
小程序
網絡
ide
this
url
spa
.net
server
資源
欄目
Unix
简体版
原文
原文鏈接
前幾天U盤丟了,心想若是能作一個小程序在U盤丟了的時候也能給我發送個郵件帶上本機的地址就行了。
結合了Autorun.inf和這個程序就沒問題了。
程序作出來了,如今的問題是,全部的機子都是在局域網,若是發送信息就會彈出失敗信息。因此能夠在發送前嘗試是否網絡通暢,不然不發之類的驗證,
可是後來懶得作了,心想人家撿到U盤,也差很少就格式化了,作了也沒用。不過卻是涉及到了一些代碼。因此存下來備份。
private
void
sengmill_net()
{
//
.net smtp類進行郵件發送,支持認證,附件添加;
System.Web.Mail.MailMessage mailmsg
=
new
System.Web.Mail.MailMessage();
mailmsg.From
=
this
.tb_from.Text.Trim();
mailmsg.To
=
this
.tb_to.Text.Trim();
mailmsg.Body
=
this
.tb_mailBody.Text.Trim();
mailmsg.Subject
=
"
test mail from hz
"
;
/**/
/*
附件的粘貼, ^_^,笨了點;
if(this.att1.Value.ToString().Trim()!=string.Empty)
mailmsg.Attachments.Add(new System.Web.Mail.MailAttachment(this.att1.Value.ToString().Trim()));
if(this.att2.Value.ToString().Trim()!=string.Empty)
mailmsg.Attachments.Add(new System.Web.Mail.MailAttachment(this.att2.Value.ToString().Trim()));
if(this.att3.Value.ToString().Trim()!=string.Empty)
mailmsg.Attachments.Add(new System.Web.Mail.MailAttachment(this.att3.Value.ToString().Trim()));
*/
mailmsg.Fields.Add(
"
[url]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate[/url]
"
,
"
1
"
);
//
是否須要驗證,通常是要的
mailmsg.Fields.Add
(
"
[url]http://schemas.microsoft.com/cdo/configuration/sendusername[/url]
"
,
"
gallon_han
"
);
//
本身郵箱的用戶名
mailmsg.Fields.Add(
"
[url]http://schemas.microsoft.com/cdo/configuration/sendpassword[/url]
"
,
"
218500
"
);
//
本身郵箱的密碼
System.Web.Mail.SmtpMail.SmtpServer
=
this
.tb_smtpserver.Text.Trim();
System.Web.Mail.SmtpMail.Send(mailmsg);
}
AutoRun.inf
[AutoRun]open=xx.exeshell\open=打開(&O)shell\open\Command=SendMailForUdisk.exeshell\open\Default=1shell\explore=資源管理器(&X)shell\explore\Command=SendMailForUdisk.exeopen=\
相關文章
1.
郵件發送
2.
發送郵件
3.
郵件開發(一) 發送郵件
4.
python發送郵件
5.
django發送郵件
6.
javamail郵件發送
7.
NodeJS發送郵件
更多相關文章...
•
PHP 發送電子郵件
-
PHP教程
•
ASP 使用 CDOSYS 發送電子郵件
-
ASP 教程
•
PHP開發工具
•
JDK13 GA發佈:5大特性解讀
相關標籤/搜索
郵件推送
收發郵件
郵件
發送
電子郵件
垃圾郵件
163郵箱發送實例
送送
系統網絡
Unix
HTTP/TCP
PHP教程
MySQL教程
SQLite教程
插件
開發工具
文件系統
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
eclipse設置粘貼字符串自動轉義
2.
android客戶端學習-啓動模擬器異常Emulator: failed to initialize HAX: Invalid argument
3.
android.view.InflateException: class com.jpardogo.listbuddies.lib.views.ListBuddiesLayout問題
4.
MYSQL8.0數據庫恢復 MYSQL8.0ibd數據恢復 MYSQL8.0恢復數據庫
5.
你本是一個肉體,是什麼驅使你前行【1】
6.
2018.04.30
7.
2018.04.30
8.
你本是一個肉體,是什麼驅使你前行【3】
9.
你本是一個肉體,是什麼驅使你前行【2】
10.
【資訊】LocalBitcoins達到每週交易比特幣的7年低點
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
1.
郵件發送
2.
發送郵件
3.
郵件開發(一) 發送郵件
4.
python發送郵件
5.
django發送郵件
6.
javamail郵件發送
7.
NodeJS發送郵件
>>更多相關文章<<