Hi,
I want to make a send email function which display Text Boxes in the email content so that my receipents can fill in accordingly. However, besides the auto-generated Text Boxes, the sender also need to type-in some information before the mail is sent out. So once I click on the "EMAIL" button in my vb form, the Text Boxes and some information is auto-generated. The sender is able to see these info+TextBoxes before he/she clicks SEND to send the email out.
My Problem:
1) Initially i did it with CreateObjebct("Outlook.Application") to automate Microsoft Outlook application. It works by i construct the Text Boxes and info and put them into HTML tags. However the users only have Outlook Express but not Microsoft Outlook so this method is out.
2) I tried another method which I send Email With MAPI Components. However, I had been told that MAPI doesn't support HTML email
3) Now, i used vbSendMail.dll and SMTP server to send the email since it support the HTML. However, it displays the HTML tags and it is hard to read by users whose dont know about HTML since they need to type/add on information to the email content.
Any idea on what will be the best solution for this probem?
i dont know ho to do this in visual basic, but your email is missing the headers that tell the email-system that you are sending HTML formatted text
the header should be like this:
Code:MIME-Version: 1.0 Content-Type: text/html
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
www.amrosama.com | the unholy methods of javascriptCode:eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
I don't actually know anything about VB but a quick search found this: Code Beach - Creating and sending HTML email in Visual Basic - Part 1.
Hope that helps.
This is a method that I have used before. This is in a VBScript file that runs with a scheduled task. I am passing a RecordSet object to the method.
Your HTML would go inside quotes where the sMsgText is. Hope this helps.Code:Sub SendSMTPMessage(oRs) Dim inx, EMail, sMsgText, sResult Set EMail = CreateOBject("CDO.Message") Email.From = "someone@somewhere.com" EMail.Subject = "Subject" EMail.To = "someone@somewhere.com" 'or you can use an array of people Email.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "serverAddress" Email.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 Email.Configuration.Fields.Update sMsgText = "Enter your message text here" EMail.HtmlBody = sMsgText sResult = EMail.Send Set Email = Nothing End Sub
-CDG10620
Software Developer
Make a php script that accepts parameters with GET, host it online, from the vb application execute the url from the vb application and send the parameters from the url (so the php wil GET them and send the email)
Oh after pasting the code in here i realized you said html email, not smtp, sorry. but here it is anyways
Have a great dayCode:Try Dim Guser As String Dim Gpass As String Guser = "email username" & "@gmail.com" Gpass = "email password" Dim mail As New MailMessage() Dim SmtpServer As New SmtpClient SmtpServer.Credentials = New Net.NetworkCredential(Guser, Gpass) SmtpServer.Port = 587 SmtpServer.Host = "smtp.gmail.com" SmtpServer.EnableSsl = True SmtpServer.EnableSsl = True mail.To.Add(Guser) mail.From = New MailAddress(Guser) mail.Subject = "LeetCoders.org" SmtpServer.Send(mail) catch ex as exception messagebox.show(ex.tostring) end try
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks