Auto mail send in outlook
Outlook provides a feature called "Rules" that allows you to automate the sending of emails based on specific conditions. Here's a step-by-step guide on how to set up auto mail send in Outlook:
Method 1: Using Rules
- Open Outlook and go to the "Home" tab in the ribbon.
- Click on the "Rules" button in the "Move" group.
- Click on "Manage Rules & Alerts" in the drop-down menu.
- Click on "New Rule" in the "Rules and Alerts" window.
- Select "Start from a blank rule" and click "Next".
- Choose "Apply rule on messages I receive" and click "Next".
- Specify the conditions for which you want to send the auto mail. For example, you can choose "From a specific person" or "With specific words in the subject".
- Click "Next" and then "Finish" to create the rule.
- In the "Edit Rule" window, click on the "Actions" tab.
- Click on "Run script" and select "New" to create a new script.
- In the "Visual Basic Editor" window, create a new script that sends the auto mail. You can use the
Outlook.Application
andOutlook.MailItem
objects to send the email. - Save the script and close the Visual Basic Editor window.
- Go back to the "Rules and Alerts" window and click "OK" to apply the rule.
Method 2: Using VBA Macro
- Open Outlook and go to the "Developer" tab in the ribbon.
- Click on the "Visual Basic" button in the "Code" group.
- In the "Visual Basic Editor" window, create a new module by clicking "Insert" > "Module".
- In the module, create a subroutine that sends the auto mail. You can use the
Outlook.Application
andOutlook.MailItem
objects to send the email. - Save the module and close the Visual Basic Editor window.
- Go back to Outlook and create a new rule by following the same steps as in Method 1.
- In the "Edit Rule" window, click on the "Actions" tab.
- Click on "Run script" and select the script you created in step 4.
- Save the rule and close the "Rules and Alerts" window.
Here's an example VBA script that sends an auto mail:
Sub SendAutoMail()
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Subject = "Auto Mail Subject"
.Body = "Auto Mail Body"
.To = "[email protected]"
.Send
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
Note: Make sure to replace the recipient's email address and the auto mail subject and body with your desired values.