Lm th? no ? thm m?t s? t? b? cho th SMTP trong Visual Basic script

D?ch tiu ? D?ch tiu ?
ID c?a bi: 317680 - Xem s?n ph?m m bi ny p d?ng vo.
? c m?t phin b?n Microsoft Visual Basic c?a bi vi?t ny, xem 317327.
Bung t?t c? | Thu g?n t?t c?

? Trang ny


Bi vi?t t?ng b?c ny cho th?y lm th? no ? s? d?ng m?t SMTP v?n chuy?n s? ki?n b?n r?a chn thm m?t s? t? b? cho i SMTP e-mail tin nh?n.

T?o s? ki?n sink

? t?o ra m?t s? ki?n ch?m, dn o?n m? sau vo m?t t?p tin m?i v lu n nh EventSinkScript.vbs.
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
   TextDisclaimer = vbCrLf & "DISCLAIMER:" & vbCrLf & "Sample Disclaimer added in a VBScript."
   HTMLDisclaimer = "<p></p><p>DISCLAIMER:<br>Sample Disclaimer added in a VBScript."

   If Msg.HTMLBody <> "" Then
      'Search for the "</body>" tag and insert our disclaimer before that tag.
      pos = InStr(1, Msg.HTMLBody, "</body>", vbTextCompare)
      szPartI = Left(Msg.HTMLBody, pos - 1)
      szPartII = Right(Msg.HTMLBody, Len(Msg.HTMLBody) - (pos - 1))
      Msg.HTMLBody = szPartI + HTMLDisclaimer + szPartII
   End If

   If Msg.TextBody <> "" Then
      Msg.TextBody = Msg.TextBody & vbCrLf & TextDisclaimer & vbCrLf
   End If
   'Commit the content changes to the transport ADO Stream object.
   Msg.DataSource.Save ' Commit the changes into the transport Stream

   EventStatus = cdoRunNextSink
End Sub

ng k? s? ki?n sink

? ng k? c?a b?n ch?m t? ch?c s? ki?n, s? d?ng cc t?p tin Smtpreg.vbs, l ci ?t Exchange SDK. T? m?t d?u nh?c l?nh, tr?nh duy?t ? cc ...\Exchange SDK\SDK\Support\CDO\Scripts th m?c v cc lo?i sau y (lm cho ch?c ch?n r?ng ?ng d?n ?n EventSinkScript.vbs l chnh xc):
cscript smtpreg.vbs / thm 1 onarrival SMTPScriptingHost CDO.SS_SMTPOnArrivalSink "th from=*@your-domain-here.com"
cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost ch?m ScriptName "C:\EventSinkScript.vbs"
N?u l?nh thnh cng, b?n nh?n ?c m?t thnh cng thng i?p ?c t?o ra b?i cc t?p l?nh.

? unregister s? ki?n ny, h?y g? cc sau:
cscript smtpreg.vbs/remove 1 OnArrival SMTPScriptingHost
? bi?t thm thng tin v? ng k? s? ki?n v?i Smtpreg.vbs, xem cc ch? ? "Qu?n l? s? ki?n Bindings" trn Web MSDN sau Trang web:
http://MSDN.Microsoft.com/en-US/Library/ms526620 (EXCHG.10) .aspx
? bi?t thm thng tin, h?y b?m vao s? bi vi?t sau ? xem bi vi?t trong C s? Ki?n th?c Microsoft:
324021Lm th? no ? t?o m?t h?p th "catchall" t?n cho Exchange Server

Ki?m tra s? ki?n sink

? ki?m tra b?n r?a chn c?a b?n, g?i th i?n t? cho m?t ng?i nh?n SMTP bn ngoi ? t? ch?c c?a b?n l ai. Ng?i nh?n s? nh?n ?c m?t s?a ?i tin nh?n v?i s? t? b? thm vo cu?i c?a tin nh?n.

Chu y N?u b?n s? d?ng m?t my khch MAPI ch?ng h?n nh Microsoft Outlook ? g?i cc e-mail v n?u h?p th Exchange n?m trn cng m?t h? ph?c v? nh l r?a chn s? ki?n rng bu?c, ng?i nh?n c th? khng nh?n ?c thng bo s?a ?i. i?u ny l do cc tin nh?n ?c g?i b?ng cch s? d?ng MAPI ang khng ? trong ?nh d?ng SMTP khi e-mail gy nn Theo t? ch?c s? ki?n SMTP v?n t?i. V? v?y, nh?ng thay ?i ?c th?c hi?n b?i cc s? ki?n m? ang khng ri.


? bi?t thm thng tin, h?y b?m vao s? bi vi?t sau ? xem bi vi?t trong C s? Ki?n th?c Microsoft:
273233B?n khng th? s?a ?i cc th MAPI ang m?c k?t trong m?t s? ki?n b?n r?a chn SMTP v?n t?i

Thu?c tnh

ID c?a bi: 317680 - L?n xem xt sau cng: 27 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Exchange Server 2003 Enterprise Edition
  • Microsoft Exchange Server 2003 Standard Edition
  • Microsoft Exchange 2000 Server Standard Edition
T? kha:
kbhowtomaster kbmt KB317680 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:317680

Cung cp Phan hi


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com