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
Re: plsssssssssssssss help help me plssssss
I don't know how to fix your problem.
What I do know is that you are more likely to get help if you change your subject to something a bit more meaningful...
Re: plsssssssssssssss help help me plssssss
Something meaningful and less annoying. If you've posted a question we know you want help. All that "plssss" makes me, for one, less likely to help.
If you're getting a data type mismatch then it means that the data you're assigning to one of the fields is the wrong type. I'm guessing that it's this:
VB Code:
message1.Attachments.Add("C:\path")
That looks like you're trying to attach a folder named "path", which ain't happening.
Re: E-mailing with attachments in vb.net
Re: E-mailing with attachments in vb.net
I just have a suggestion = Google Indy.Sockets and go to the first page....:D
Re: E-mailing with attachments in vb.net
i didn't added the reffrance system.web that why it don't worked
thx any way