Hi,
I dont know if it is possible but can I program a code to send an email automatically (without using Outlook) when an order status has been changed to "Ready"?
So in the Order form, when the Status textbox value="Ready", it will start countdown on for example 5 days after that, and it will automatically send a simple email.
Currently I have this code
**note: I already copied a code from to a module which has function SendEMail()
This code is triggered with a button click, but when I click a button, nothing is happened (i.e no email was received to the recipient).
So in conclusion, I have two questions:
1. How to send this simple email without using Outlook ( I dont want any warnings/more input, just automatically send the email)
2. How to trigger sending the email after a set of time (5 days)
I dont know if it is possible but can I program a code to send an email automatically (without using Outlook) when an order status has been changed to "Ready"?
So in the Order form, when the Status textbox value="Ready", it will start countdown on for example 5 days after that, and it will automatically send a simple email.
Currently I have this code
Code:
Private Sub Sendmaila_Click()
Dim Subject As String
Dim MailTo As String
Dim MailFrom As String
Dim BodyText As String
Dim Result As Boolean
Dim ServerName As String
Subject = "Hello World"
MailTo = "****@yahoo.com"
MailFrom = "****@gmail.com"
BodyText = "This is the body of the email message"
ServerName = "smtp.gmail.com"
Result = SendEMail( _
Subject:=Subject, _
FromAddress:=MailFrom, _
ToAddress:=MailTo, _
MailBody:=BodyText, _
SMTP_Server:=ServerName, _
BodyFileName:=vbNullString)
End Sub
This code is triggered with a button click, but when I click a button, nothing is happened (i.e no email was received to the recipient).
So in conclusion, I have two questions:
1. How to send this simple email without using Outlook ( I dont want any warnings/more input, just automatically send the email)
2. How to trigger sending the email after a set of time (5 days)