Send email through vb application with format

gloringg

Member
Joined
Jan 11, 2009
Messages
16
Programming Experience
Beginner
Hi,

I have a mail format with me which looks like this

Date (today)

Name | Email address | Age| Date of movement
__________________________________________

ABC ABC@ABC.com 35 1/12/08


and i created an applcation using vb2008 and access 2033 database where i have these contacts details

But when i remove one from the database. I would like to automartically send an email with the removed contact details.

currently i have :

VB.NET:
objOutlook = CreateObject("Outlook.Application")
        objOutlookMsg = objOutlook.CreateItem(0)
        With objOutlookMsg
            .To = ""
            .Cc = ""
            .Subject = "Subject"
            .Body = Date.Today & vbCrLf & "Name |     Email Address| Age| Date of Movement" & vbCrLf & "____________________________________________________________________________________" & vbCrLf & vbCrLf & textbox1.Text & "                    " & textbox2.Text & "      " & textbox3.Text

            .Display() 'Let´s go!
        End With
        objOutlookMsg = Nothing
        objOutlook = Nothing

THis is sending th email properly in a text format.

But all i want is to send the email with format and the values of the removed contact detils in a table.

Is there any way to do this?

Thanks
 
VB.NET:
Dim app As New Outlook.Application
Dim mi As Outlook.MailItem = CType(app.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)
mi.To = "test@some.com"
mi.Subject = "some subject"
mi.BodyFormat = Outlook.OlBodyFormat.olFormatHTML
mi.HTMLBody = "hello <b>Outlook</b> message"
 
thanks

thanks for your reply.

THis is very useful.

but can you tell me how to insert the data as a table example

Name | Age| Date of movement
ABC | 25 | 1/12/09

or else when the email is created

the data is pasted incorrectly without order, in some cases age is coming under date of movement.

btw the data if coming form a datagrid. I have the code to get the values but not sure how to get this like a table.

Thanks,
 
Back
Top