????? ??????? ????? CDOSYS ?????? ????? ???? ???????? ???????? ???? SMTP ?? Visual Basic .NET

?????? ????????? ?????? ?????????
???? ???????: 313775 - ??? ???????? ???? ????? ????? ??? ???????.
????? ADO ? MD ADO ?? ??? ???? ???? ???????? ?? ???? Microsoft .NET Framework. ?? ???? ??? ??? ???? ?????? ?????? ???? ?? ????????? ???????? ??? ???? ?? ?? ??????? ??? ?????? ??????? ????????. ??? ??????? ???????? ???? ??? ???????? ?? ??? ??????? ??? ?????? ???? ????? ??????? ??? ADO.NET. ??? ??????? ??? ???????? ??? ??? ????? ?????? ????? ?????? ?? ??? ???? ?????? ?????. ?? ?? ???????? ???? ???? ?? ???? ??????? ADO ?? MD ADO ???? ??????? ??? ??????. ????? ?? ?????????? ???? ??????? ??????? ?? "????? ??????? ?? Microsoft:
840667 ???? ????? ??? ?????? ??? ??????? ADO ? MD ADO ?? ????? .NET Framework
????? ???? | ?? ????

??????

???? ??? ??????? ????? ??????? ?????? ?????? ??????? (CDO) ?? Windows 2000 (CDOSYS) ????? ?????? ????? ???? ???????? ???????? ???? ???????? ??? ?????? ?????? (SMTP) ?? Microsoft Visual Basic .NET.

??????? ????

?????? ????? ???? ???????? ???????? ???? SMTP ???? ??????? ???????:
  1. ??? ????? Microsoft Visual Studio .NET.
  2. ?? ??????? ???? ??? ??? ???? ?? ???? ??? ???????.
  3. ?? ??????? ????? ?????? Visual Basic ? ???? ??? ????? ???? ??????.

    ?????????? ??? ????? ??? Module1.vb.
  4. ????? ???? ??? CDO ?? Windows 2000 ????? Microsoft. ?????? ????? ???? ??????? ???????:
    1. ?? ??????? ??????? ???? ??? ????? ????.
    2. ???? ??? ????? ??????? COM ????? ???? CDO Microsoft ?? Windows 2000 ????? ?? ?? ???? ??? ?????.
    3. ?? ???? ?????? ????? ????? ? ???? ??? "?????".
    4. ??? ??? ??????? ?????? wrappers ???????? ???? ?????? ???? ??? "???".
  5. ??? ?????? 4 ?????? ???? ??? ????? 2.5 ?????? ?????? Microsoft ActiveX.
  6. ?? ???? ????????? ???????? ?????? ???????? ???????? ???????: oMsg
    Imports System.Reflection
    
    Module Module1
    
        Sub Main()
            Dim oMsg As CDO.Message = New CDO.Message()
            Dim iConfg As CDO.Configuration
            Dim oFields As ADODB.Fields
            Dim oField As ADODB.Field
     
            iConfg = oMsg.Configuration
            oFields = iConfg.Fields
    
            oField = oFields("http://schemas.microsoft.com/cdo/configuration/sendusing")
            oField.Value = CDO.CdoSendUsing.cdoSendUsingPort
    
           ' TODO: Replace with the port that you want to use . It must be the same
           ' port that the SMTP server is using.
           oField = oFields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
            oField.Value = 25
    
            ' TODO: Replace with your SMTP server.
            oField = oFields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
            oField.Value = "<SMTP Server>"
    
            oFields.Update()
            oMsg.Configuration = iConfg
    
            oMsg.TextBody = "Test message body."
            oMsg.Subject = "Test SMTP Message Send using port"
            oMsg.From = "from@example.com"
            oMsg.To = "to@example.com"
    
            oMsg.Send()
    
            oMsg = Nothing
            iConfg = Nothing
            oFields = Nothing
            oField = Nothing
        End Sub
    
    End Module
    					
  7. ????? ?? TODO ?? ????????? ???????? ?? ?? ?????? ????????? ???????? ?????? ?????? ??.
  8. ???? F5 ?????? ? ?????? ????????.
  9. ???? ?? ??? ?? ????? ????? ?????? ?????????? ? ?? ????.

???????

???? ???????: 313775 - ????? ??? ??????: 19/?? ??????/1428 - ??????: 3.2
????? ???
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft Collaboration Data Objects 2.0
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
????? ??????: 
kbmt kbhowto kbcode kbxml kbmsg KB313775 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????313775

????? ???????

 

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