使用ASP.Net,VB.Net
在我的网页中,我有文本框值
当我按下发送按钮时,文本框值会自动发送到电子邮件地址...
怎么做......
需要代码帮助
答案 0 :(得分:2)
代码示例如下:
Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
oMsg.From = "noone@nobody.com"
oMsg.To = "someone@somewhere.com"
oMsg.Subject = "Email with Attachment Demo"
oMsg.Body = "This is the main body of the email"
Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip")
oMsg.Attachments.Add(oAttch)
SmtpMail.Send(oMsg)
您还可以找到一个示例;在以下链接中:
答案 1 :(得分:1)