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

vb 6 send email with attachment

$
0
0
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

Viewing all articles
Browse latest Browse all 21096

Trending Articles



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