嵌入式个性化脚本范例
一个简单例子
<% For i = 1 To 100 Body.WriteLine i & vbCrLf Next %>
输出收件人的所有属性
<% For i = 0 To User.PropertyCount - 1 Body.WriteLine i & ":" & User.Properties(i) Next %>
"xyz.com"域名下的收件人收到指定文件的邮件内容
<% If InStr(1, User("Email"), "@xyz.com", vbTextCompare) <> 0 Then Body.LoadFromFile "d:\mails\abc.txt" ' path must be changed Else %> Standard Text or HTML <% End If %>
对"xyz.com"产品有兴趣的的收件人收到额外的附件
<% If User("InterestXYZ") = True Then Message.Attachments.Add "d:\productinformation\productxyz.pdf" ' path must be changed End If %>
*(此处假设您的列表中包含"InterestXYZ"属性)
祝贺今天过生日的收件人
<% If IsDate(User("birthday")) Then Dim dtBirthDay dtBirthDay = CDate(User("birthday")) If Month(dtBirthday) = Month(Now) And Day(dtBirthday) = Day(Now) Then Message.Subject = Message.Subject & " (Happy birthday!)" ' Insert a card file with congratulation Body.LoadFromFile "d:\birthday.txt" ' path must be changed End If End If %>
*(此处假设您的列表中包含"Birthday"属性)