I am trying to write a program that will send email with an attachment in VB6.I'm using cdo but it doesn't work please help me thanks in advance.
I'm getting an error in this line -cdo_msg.Send-
Private Sub cmdSend_Click()
Dim cdo_msg As Object
Set cdo_msg = CreateObject("CDO.Message")
cdo_msg.Subject = txtSubject.Text
cdo_msg.From = txtFrom.Text
If Len(txtTo.Text) > 0 Then cdo_msg.To = txtTo.Text
If Len(txtCc.Text) > 0 Then cdo_msg.Cc = txtCc.Text
If Len(txtBcc.Text) > 0 Then cdo_msg.Bcc = txtBcc.Text
If Len(txtAttachment.Text) > 0 Then
cdo_msg.AddAttachment txtAttachment.Text
End If
cdo_msg.TextBody = txtBody.Text
cdo_msg.Send
Set cdo_msg = Nothing
I'm getting an error in this line -cdo_msg.Send-
Private Sub cmdSend_Click()
Dim cdo_msg As Object
Set cdo_msg = CreateObject("CDO.Message")
cdo_msg.Subject = txtSubject.Text
cdo_msg.From = txtFrom.Text
If Len(txtTo.Text) > 0 Then cdo_msg.To = txtTo.Text
If Len(txtCc.Text) > 0 Then cdo_msg.Cc = txtCc.Text
If Len(txtBcc.Text) > 0 Then cdo_msg.Bcc = txtBcc.Text
If Len(txtAttachment.Text) > 0 Then
cdo_msg.AddAttachment txtAttachment.Text
End If
cdo_msg.TextBody = txtBody.Text
cdo_msg.Send
Set cdo_msg = Nothing