Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21278

Send Email is showing error Transport failed to server

$
0
0
Am using the following code to send mail

Code:

Dim Mg As Message
    Dim iConf As Configuration
    Dim fn, schema
    Set Mg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    Set fn = iConf.Fields
    schema = "http://schemas.microsoft.com/cdo/configuration/"
    fn.Item(schema & "sendusing") = 2
    fn.Item(schema & "smtpserver") = StrHostName
    fn.Item(schema & "smtpserverport") = IntPort
    fn.Item(schema & "smtpauthenticate") = 1
    fn.Item(schema & "sendusername") = Trim(lblSender.Caption)
    fn.Item(schema & "sendpassword") = strPassword
    fn.Item(schema & "smtpusessl") = 1
    fn.Update

    lblStatus.Caption = "Connecting...."
    With Mg
        .To = Trim(txtTo.Text)
        .From = Trim(lblSender.Caption)
        .Subject = txtSubject.Text
        .TextBody = txtMessage.Text
        .Sender = Trim(lblSender.Caption)
        If Trim(lblAttach1.Caption) <> "" Then
        .AddAttachment lblAttach1.Caption
        End If
        .ReplyTo = Trim(lblSender.Caption)
        Set .Configuration = iConf
        .Send
    End With
   
    Set Mg = Nothing
    Set iConf = Nothing
    lblStatus.Caption = "Mail sent successfully!!"

it worked previously...when i was in windows xp. nw am changed it to windows 8 and its continuously showing this error

Please help me...

Viewing all articles
Browse latest Browse all 21278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>