Am using the following code to send mail
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...
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!!"
Please help me...