不用附件试试,我的是不用附件,可以参考一下:Dim m As New MailSender
m.Host = "smtp.qq.com" '用于指定主机地址,可以是域名,也可以是IP地址,不需要修改
m.EnableSsl = True '必须将EnableSsl属性设置为True
m.Account = "2********1" '用于指定登录邮件服务器的帐号,使用那个账号发送邮件
m.Password = "me************ee" '注意这不是QQ密码,是授权码,请自行申请
m.From = "2********1@qq.com" '指定发件人的邮件地址
Dim rs As List(Of Row) = Tables("工资发送表").GetCheckedRows()
If rs.Count > 0 Then
For Each r As Row In rs
m.To = r("接收邮箱")
m.Title = r("所属年度") & "年" & r("所属月度") & "月" & "工资发放详情" '邮件标题
Dim v As String
v = "基本工资:" & r("基本工资") & "元;" & "工龄工资:" & r("工龄工资") & "元;"
v = v & vbcrlf & "全勤工资:" & r("全勤工资") & "元;" & "岗位工资:" & r("岗位工资") & "元;"
v = v & vbcrlf & "绩效工资:" & r("绩效工资") & "元;" & "证书补贴:" & r("证书补贴") & "元;"
v = v & vbcrlf & "午餐补贴:" & r("午餐补贴") & "元。"
v = v & vbcrlf & "应扣社保:" & r("应扣社保") & "元;" & "应扣个税:" & r("应扣个税") & "元;"
v = v & vbcrlf & "应扣缺勤:" & r("应扣缺勤") & "元。"
v = v & vbcrlf & "实发工资:" & r("应发工资") & "元。"
m.Content = v
m.Send()
Next
Else
MessageBox.Show ("请先勾选要发送的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
e.Cancel = True
Return
End if
[此贴子已经被作者于2024/6/24 11:10:53编辑过]