Send e-mail to GroupWise using VBA

Vansweevelt

New Member
Joined
Aug 31, 2021
Messages
1
Office Version
  1. 2010
Platform
  1. Windows
I have created a VBA code that an e-mail over GroupWise will pop-up automatically when a due date is passed (subject and email address filled in automatically).
E-mail dialog opens when closing the excel-file.

Question: is there a possibility to skip the dialog and let the VBA code directly send the mail ? So avoid opening the e-mail and manually clicking on "send" ?
Code:
Option Explicit

Sub Mail()

Dim path1 As String
Dim path2 As String
Dim name1 As String
Dim name2 As String
Dim fn As String
Dim subj As String
Dim r1 As String
Dim recip As Variant
Dim x As Integer
Dim i As Long
Dim rw As Long
Dim rws As Long
Dim d As Date

rws = Application.WorksheetFunction.CountA(Sheets("ShortTerm").Range("E5:E30"))

For i = 1 To rws

d = Format(Now(), "dd/mm/yyyy")

If Sheets("ShortTerm").Cells(i + 4, 8) <= d - 1 And Sheets("ShortTerm").Cells(i + 4, 9) = False Then

rw = i + 4
path1 = Sheets("ShortTerm").Cells(rw, 18)
name2 = Sheets("ShortTerm").Cells(rw, 19)
r1 = Sheets("ShortTerm").Cells(rw, 7)
recip = Array(r1)
subj = "To Do !! " & Sheets("ShortTerm").Cells(rw, 5)

name1 = ActiveWorkbook.Name

Application.MailLogon "Novell Default Settings"
Application.Dialogs(xlDialogSendMail).Show (recip), (subj)

End If

Next i

End Sub
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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