Results 1 to 6 of 6

Thread: E-mailing with attachments in vb.net

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member demon.KILER's Avatar
    Join Date
    Jul 2006
    Location
    I cannot remember !?
    Posts
    408

    Question E-mailing with attachments in vb.net

    the following code is for emailing in vb .net but I get this error

    Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
    for this line
    message1.attachments.add("C:\Test.txt")




    message1 = CreateObject("CDO.Message")
    Conf = CreateObject("CDO.Configuration")
    Fields = Conf.Fields

    ' send one copy with Google SMTP server (with autentication)
    acsessing = "http://schemas.microsoft.com/cdo/configuration/"
    Fields.Item(acsessing & "sendusing") = 2
    Fields.Item(acsessing & "smtpserver") = dom
    Fields.Item(acsessing & "smtpserverport") = 465
    Fields.Item(acsessing & "smtpauthenticate") = 1
    Fields.Item(acsessing & "sendusername") = username
    Fields.Item(acsessing & "sendpassword") = ps.Text
    Fields.Item(acsessing & "smtpusessl") = 1
    Fields.Update()

    message1.To = tooo
    message1.From = username
    message1.Subject = subject
    message1.HTMLBody = body
    message1.Sender = sender1
    message1.ReplyTo = username
    message1.Configuration = Conf
    message1.attachments.add("C:\Test.txt")
    sendemailgmail = message1.Send
    can any one help me pls
    Last edited by demon.KILER; Jul 16th, 2006 at 11:21 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width