Public Function Fsyj(StrFsyx As String, StrFsmm As String, StrFsbt As String, StrFsnr As String, StrFsfw As String, StrJsyx As String) As BooleanstrName = "http://schemas.microsoft.com/cdo/configuration/"Set objEmail = CreateObject("CDO.Message") Fsyj = False objEmail.From = StrFsyx '发送邮件搭空帆地址 objEmail.To = StrJsyx '接受邮件地址 objEmail.Subject = StrFsbt '邮件标题 objEmail.Textbody = StrFsnr '邮件内容 objEmail.Configuration.Fields.Item(strName & "sendusing") = 2 objEmail.Configuration.Fields.Item(strName & "smtpserver") = StrFsfw 'smtp.163.com发送邮箱的服务器 objEmail.Configuration.Fields.Item(strName & "smtpserverport") = 25 objEmail.Configuration.Fields.Item(strName & "smtpauthenticate") = 1 objEmail.Configuration.Fields.Item(strName & "sendusername"亏唤) = Left(StrFsyx, InStr(StrFsyx, "@") - 1) objEmail.Configuration.Fields.Item(strName & "sendpassword") = StrFsmm '发送邮件知雹邮箱密码 objEmail.Configuration.Fields.Update objEmail.Send Fsyj = TrueEnd FunctionPrivate Sub Cmd1_Click()k = Fsyj("**@163.com", "********", txt1, txt2, "smtp.163.com", "**@qq.com")End Sub请参阅我的博客:http://hi.baidu.com/zgmg/blog/item/77ffee1780f5b702c83d6d35.html
相关文章
-
VB中randomize怎么用
2023-11-24 20:38 阅读(583) -
邮件合并的主要作用是什么?
2023-10-29 11:59 阅读(581) -
VB中Str()的作用
2023-10-17 11:23 阅读(541)