VB.net 调用OutLook发邮件(程序自动添加附件)

前端之家收集整理的这篇文章主要介绍了VB.net 调用OutLook发邮件(程序自动添加附件)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

DimrkeyAsMicrosoft.Win32.RegistryKey
DimpathAsString
DimsubjectAsString
DimEmailToAsString
DimAttachPathAsString

rkey=Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(@H_404_9@mailto/shell/open/command@H_404_9@)取得@H_404_9@Outlook程序位置
IfrkeyIsNotNothingThen
path=rkey.GetValue(“”@H_404_9@).ToString()&”“
path=path.Substring(0,path.IndexOf(”“@H_404_9@))
path=path.Replace(“”@H_404_9@"@H_404_9@,“”@H_404_9@)
rkey.Close()
Try
subject=@H_404_9@hello
EmailTo=myfriend@hotmail.com
AttachPath=@H_404_9@c:/sss.txt
System.Diagnostics.Process.Start(path,@H_404_9@-cIPM.Note/m@H_404_9@&EmailTo.Trim&@H_404_9@&subject=@H_404_9@&subject.Trim&””@H_404_9@&AttachPath.Trim)
CatchexAsException

EndTry EndIf

猜你在找的VB相关文章