VB.net 調用OutLook發郵件(程序自動添加附件)

Dim rkey As Microsoft.Win32.RegistryKey
Dim path As String
Dim subject As String
Dim EmailTo As String
Dim AttachPath As String

rkey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(mailto/shell/open/command)  取得Outlook程序位置
If rkey IsNot Nothing Then
path = rkey.GetValue(“”).ToString() & ” “
path = path.Substring(0, path.IndexOf(” “))
path = path.Replace(“”"“”)
rkey.Close()
Try
subject = hello
EmailTo = [email protected]
AttachPath = c:/sss.txt
System.Diagnostics.Process.Start(path, -c IPM.Note /m ” & EmailTo.Trim & &subject=” & subject.Trim & ” ” & AttachPath.Trim)
Catch ex As Exception

End Try
End If

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章