Results 1 to 1 of 1
  1. #1
    Join Date
    Jun 2006
    Posts
    1

    Question Unanswered: E-mailing with an attachment 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; 07-16-06 at 13:20.

Posting Permissions

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