1 2 3 4 5 6 7 | Dim instance As WebMail Dim mailfrom As String '送信元メールアドレス Dim mailto As String '送信先メールアドレス Dim subject As String '題名 Dim body As String '本文 instance.MailMessage(mailfrom, mailto, subject, body) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 'WebMailクラス MailMessageメソッド Imports System.Windows.Forms Public Class AddIn Private Const CRLF = Microsoft.VisualBasic.ControlChars.CrLf Public Sub AddIn_Start() Dim bdy As String = "テスト商事 御中" & CRLF _ & "西都路地 様" & CRLF _ & CRLF _ & "テストメールの送信です" & CRLF Dim wm As WebMail = New WebMail() wm.SmtpClient( "smtp.sample.jp" , "sampleuser" , "passxxx" ) wm.MailMessage( "info@sample.jp" , "info@tosample.jp" , "テストメールです" , bdy) If wm.Send() = True Then MessageBox.Show( "メール送信成功しました" ) Else MessageBox.Show( "メール送信失敗しました" ) End If End Sub End Class |