NameSpace = "http://schemas.microsoft.com/cdo/configuration/" Set Email = CreateObject("CDO.Message") Email.From = "xxxx@xxxx.com" Email.To = "yue.yang@xxxx.com,yangkeping@xxxx.com" Email.Subject = "MySQL Bak" Email.Textbody = "MySQL 数据每日备份" y = year(Now) m = Month(Now) d = day(Now) If len(m) = 1 Then m = "0" & m If len(d) = 1 Then d = "0" & d fileName = y&""&m&""&d Email.AddAttachment "c:\mysql_bak\sql\gbds_"+fileName+".sql" With Email.Configuration.Fields .Item(NameSpace&"sendusing") = 2 .Item(NameSpace&"smtpserver") = "smtp.qiye.163.com" .Item(NameSpace&"smtpserverport") = 25 .Item(NameSpace&"smtpauthenticate") = 1 .Item(NameSpace&"sendusername") = "xxxx@xxxx.com" .Item(NameSpace&"sendpassword") = "xxxxx" .Update End With Email.Send