Send Email code in VB.NET

原创 2007年10月12日 10:19:00
Dim mailserver As String
mailserver ="test"
 Private Function SendEmail(ByVal reportname As String, ByVal MailAddress As String, ByVal filename As String) As Boolean
        'Send Email到指定Email Address
        Try
            Dim mesbody As String 'MAIL主体
            mesbody = "   test<BR><BR>"
            mesbody += Errorinfo
            Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
            Message.To = MailAddress '接收人,多个用分号;隔开
            Message.From = "Admin" '发送者
            Message.Subject = reportname '标题
            Message.Body = mesbody
            Message.BodyFormat = MailFormat.Html '编码方式
            Try
                If System.IO.File.Exists(filename) Then '如果指定的附加文件存在,粘贴附件
                    Dim myAttachment As MailAttachment = New MailAttachment(filename)
                    Message.Attachments.Add(myAttachment)
                End If
                SmtpMail.SmtpServer = mailserver '设置MAIL服务器
                SmtpMail.Send(Message)
                Return True
            Catch ex As Exception
                StatusBar1.Panels(1).Text = "Error: " & ex.Message
                Return False
            End Try
        Catch ex As Exception
            Return False
        End Try
    End Function 

Some java code for sending email

  • 2009年08月24日 11:10
  • 990KB
  • 下载

Java sendemail

jar  在下面自己下载 package org.mail; import java.util.Properties; import javax.activation.DataHandler...
  • Demon_311
  • Demon_311
  • 2015-10-23 09:57:41
  • 571

Android开发&send email

Android接收和发送邮件是通过邮局协议(pop3)和简单邮件传输协议(smtp)实现的。...
  • lovingning
  • lovingning
  • 2015-11-05 21:42:14
  • 557

SendEmail javaEmail发送邮件

package com.org; import java.util.Date; import java.util.Properties; import javax.activation.Data...
  • ITdada
  • ITdada
  • 2012-09-13 15:39:07
  • 2676

An attempt was made to send an email when no email session has been established,SSIS用sql2008发邮件失败

An attempt was made to send an email when no email session has been established,SSIS用sql2008发邮件失败...
  • lanmao100
  • lanmao100
  • 2010-05-31 16:50:00
  • 1687

Salesforce: How to Send Email with Default Template?

Salesforce: How to Send Email with Default Template? Send an Email is standard Salesforce f...
  • Salesforce_Samba
  • Salesforce_Samba
  • 2015-04-18 10:55:08
  • 706

c 实现的stmp

  • 2013年07月25日 16:43
  • 1KB
  • 下载

android send email demo

本文代码基于下面几个类包:compile ‘com.sun.mail:android-mail:1.5.5’ compile ‘com.sun.mail:android-activation:1.5...
  • aikongmeng
  • aikongmeng
  • 2017-02-28 15:44:28
  • 468

【Android基础】调用系统发Email和短信

调用系统发短信的代码:Uri smsToUri = Uri.parse("smsto:");// 联系人地址 Intent mIntent = new Inten(android.content.I...
  • boyupeng
  • boyupeng
  • 2011-02-18 17:29:00
  • 5870

VB.NET发送电子邮件(通过使用SmtpClient类)

VB.NET发送电子邮件(通过使用SmtpClient类)
  • pashine
  • pashine
  • 2014-01-09 19:39:49
  • 8865
收藏助手
不良信息举报
您举报文章:Send Email code in VB.NET
举报原因:
原因补充:

(最多只允许输入30个字)