'生成模版
Dim
Book As New XLS.Book(ProjectPath & "Attachments\出库单.xls")
Dim fl As String = ProjectPath & "Reports\出库单.xls"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
’发送生成的报表
Dim r As row = Tables("xxx").Current
Dim m As New MailSender
m.Host = "smtp.21cn.net"
m.Account = "xiaoliu"
m.Password = "xiaoliu1234567"
m.From = "xiaoliu@Sina.com.cn"
m.To = "meili@Sina.com.cn"
m.Title = "初稿已经完成"
m.Content = "附件为初稿, 请您审阅!"
m.AddAttachments(fl) '生成的报表
if r.Isnull("附加档案1") = False Then
m.AddAttachments(projectpath & "Attachments\" & r("附加档案1"))
End if
if r.Isnull("附加档案2") = False Then
m.AddAttachments(projectpath & "Attachments\" & r("附加档案2"))
End if
m.SendAsync()
[此贴子已经被作者于2014-3-9 23:14:06编辑过]