UserForm to send email

Antonio12

Board Regular
Joined
Jul 11, 2012
Messages
73
Hello All:

I'm hopping someone can help me with this so if you know, please do Help!!! I have office 2007 and run WinXP

I created a userform with 2 text boxes, 2 Checkboxes, a send button and a cancel button.

I need a code will allow the user to click send, and it will send the information on the userform straight to my email.

If possible I would like to have the Subject of the email with the information that is in the checkbox
In the text of the email the information that is in the first textbox
And finally the information that is in the other textbox.

Is this possible? Can someone please help!

Thank you all
 

Antonio12

Board Regular
Joined
Jul 11, 2012
Messages
73
Thank you for the information, but it did not help. what i have so far is this:

Private Sub Enviar_Click()


Dim OutApp As Object
Dim OutMail As Object


Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)


On Error Resume Next
With OutMail
.To = "antonio.rodrigues@gmail.com"
.CC = ""
.BCC = ""
.Subject = "SL Report"
' .Display 'Comment Out This Line
.Send 'or use .Display 'Uncomment This Line
.Body = "This message was sent via a button on the form..."
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0


Set OutMail = Nothing
Set OutApp = Nothing


End Sub

Now what I need is the information in the userform to be sent along with the email. I have two textboxes and two checkboxs.
 

Antonio12

Board Regular
Joined
Jul 11, 2012
Messages
73
Can somebody please help me!
 

BrianExcel

Well-known Member
Joined
Apr 21, 2010
Messages
879
Antonio,

Since your code above contains your email address, I went ahead and sent an example workbook to you via that address. Feel free to take a look and ask more questions if needed.
 

Forum statistics

Threads
1,082,283
Messages
5,364,268
Members
400,787
Latest member
bs04c

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top