Hey all, i have this code that allowed me to send my excel sheet to emails through outlook, however im looking to use it through my personal account and am trying to figure out how i should change what i have to make it work.
Private Sub Submit_Click()
Dim xOutlookObj As Object
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
On Error Resume Next
Set xOutApp = CreateObject("outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "You Have recieved a new Shopping List." & vbNewLine & vbNewLine & _
"Use this if you want a separate line of text" & vbNewLine & _
"Use this if you want another separate line of text"
On Error Resume Next
With xOutMail
.To = "nicholaskimberley99@gmail.com"
.CC = ""
.BCC = ""
.Subject = "Enter the Email Subject Here"
.Body = xMailBody
.Attachments.Add ActiveWorkbook.FullName
.Display 'or use .Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub
Private Sub Submit_Click()
Dim xOutlookObj As Object
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
On Error Resume Next
Set xOutApp = CreateObject("outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "You Have recieved a new Shopping List." & vbNewLine & vbNewLine & _
"Use this if you want a separate line of text" & vbNewLine & _
"Use this if you want another separate line of text"
On Error Resume Next
With xOutMail
.To = "nicholaskimberley99@gmail.com"
.CC = ""
.BCC = ""
.Subject = "Enter the Email Subject Here"
.Body = xMailBody
.Attachments.Add ActiveWorkbook.FullName
.Display 'or use .Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub