I have made some changes in this code, after I have changed it it said variable not defined what can I do to solve this question?=) thz alot!have defined the name of the textbox for tutor email to be TutorEmail
and the name of the textbox for student email to be Email . Thanks alot=)
Private Sub cmdEmail_Click()
Dim varTo As Variant
Dim y As Variant
TutorEmail.Text = varTo
Email.Text = y
'With acknowledgement of: www.paulsadowski.com
'Sending a text email using a remote server.
'Sometimes you need to send email using another server. It may be required by your
'company, or your ISP may be blocking the SMTP port, or your dynamic IP may be
'blacklisted for being in a dynamic pool.
'This code shows you how to use a remote server rather than the SMTP server
'on your own machine.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = varTo
objMessage.To = y
objMessage.TextBody = "This is some sample message text."
'This section provides the configuration information for the remote SMTP server.
'Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "172.16.2.25" 'Our SMTP Server
'Server port (typically 25)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'End remote SMTP server configuration section
objMessage.Send
End Sub
and the name of the textbox for student email to be Email . Thanks alot=)
Private Sub cmdEmail_Click()
Dim varTo As Variant
Dim y As Variant
TutorEmail.Text = varTo
Email.Text = y
'With acknowledgement of: www.paulsadowski.com
'Sending a text email using a remote server.
'Sometimes you need to send email using another server. It may be required by your
'company, or your ISP may be blocking the SMTP port, or your dynamic IP may be
'blacklisted for being in a dynamic pool.
'This code shows you how to use a remote server rather than the SMTP server
'on your own machine.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = varTo
objMessage.To = y
objMessage.TextBody = "This is some sample message text."
'This section provides the configuration information for the remote SMTP server.
'Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "172.16.2.25" 'Our SMTP Server
'Server port (typically 25)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'End remote SMTP server configuration section
objMessage.Send
End Sub
Last edited: