可以发邮件到邮箱,通过手机绑定邮箱。。你懂滴。。
Sub SentMail(strM As String, strMailAddress As String)
On Error Resume Next
Dim NameSpace As String
Dim Email As Object
NameSpace = "http://schemas.
Set Email = CreateObject("CDO.Message")
With Email
.FROM = "12@
'发件邮箱
.To = strMailAddress
'收件邮箱
.CC = Null
'抄送
.Subject = strM
'邮件主题
.TextBody = strM
'邮件内容
'
If Dir("C:\1.txt") <> "" Then
'
.AddAttachment "C:\1.txt"
'附件
'
End If
With Email.Configuration.Fields
.Item(NameSpace & "sendusing") = 2
.Item(NameSpace & "smtpserver") = "smtp.
.Item(NameSpace & "smtpserverport") = 25
'端口,不要改!
.Item(NameSpace & "smtpauthenticate") = 1
.Item(NameSpace & "sendusername") = "12@
'邮箱用户名 可申请一个邮箱
.Item(NameSpace & "sendpassword") = "123456"
'邮箱密码
.Update
End With
.Send
End With
'
If err.Number <> 0 Then
'
MsgBox "无法发送邮件:" & err.Description
'
Else
'
MsgBox "邮件发送成功", vbInformation
'
End If
Set Email = Nothing
End Sub