VBA - Send Excel Userform Data to Outlook Email

kaemerso

New Member
Joined
Oct 26, 2017
Messages
10
Hello All,

I want to send the entry from a userform to an email box. I have everything set up correctly. But the code is only sending the "entries" and not the labels, etc.

See below:[

CODE]Dim olapp As Outlook.Application
Set olapp = CreateObject("outlook.application")

Dim olmail As Outlook.MailItem
Set olmail = olapp.CreateItem(olMailItem)
On Error Resume Next
With olapp

olmail.To = "notifications.hov@gmail.com" & ";" & Me.ComboBox3 & "@gmail.com" & ";" & Me.ComboBox6 & "@gmail.com"
olmail.Subject = "Drawing/PL Rejection Notification"
olmail.Body = "Please see Feedback from Drawing/PL Submittal:" & vbCrLf & vbCrLf & Me.ComboBox1.Value & vbCrLf & Me.ComboBox2.Value & vbCrLf & Me.ComboBox3.Value & vbCrLf & Me.TextBox1.Value & vbclrf & Me.TextBox2.Value & vbCrLf & Me.ComboBox4.Value & vbCrLf & Me.ComboBox5.Value & vbCrLf & Me.TextBox3.Value & vbCrLf
olmail.Send
End With

Application.DisplayAlerts = False
erow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row[/CODE]


How can I format the body better? I keep reading about HTML tags but Im not sure where to go with this.

Thank you.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This is it in quotes, sorry about that:

Code:
Dim olapp As Outlook.Application
 Set olapp = CreateObject("outlook.application")

    Dim olmail As Outlook.MailItem
    Set olmail = olapp.CreateItem(olMailItem)
 On Error Resume Next
    With olapp

    olmail.To = "notifications.hov@gmail.com" & ";" & Me.ComboBox3 & "@gmail.com" & ";" & Me.ComboBox6 & "@gmail.com"
    olmail.Subject = "Drawing/PL Rejection Notification"
    olmail.Body = "Please see Feedback from Drawing/PL Submittal:" & vbCrLf & vbCrLf & Me.ComboBox1.Value & vbCrLf & Me.ComboBox2.Value & vbCrLf & Me.ComboBox3.Value & vbCrLf & Me.TextBox1.Value & vbclrf & Me.TextBox2.Value & vbCrLf & Me.ComboBox4.Value & vbCrLf & Me.ComboBox5.Value & vbCrLf & Me.TextBox3.Value & vbCrLf
    olmail.Send
 End With

 Application.DisplayAlerts = False
 erow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top