嵌入式個性化腳本范例
一個簡單例子
<% 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"屬性)