Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Sub sendEmail(ByVal name As String, _ ByVal campusbox As String, _ ByVal recieveddate As String, _ ByVal shippingmethod As String, _ ByVal trackingnumber As String, _ ByVal packagetype As String, _ ByVal noticelevel As String, _ ByVal locker As String, _ ByVal email As String, _ ByVal originator As String) Try ''get the settings from the admin table If email.Contains("@") Then ''create the body of the email Dim emailbody As String = "" emailbody = emailbody & _ "Hello " & name & _ ",<br>" & originator & " shipped a package to your campus box (" & campusbox _ & ") via " & shippingmethod & " that arrived at the postoffice " & recieveddate _ & ".<br> The tracking number is " & trackingnumber If locker.Length > 0 Then emailbody = emailbody & ".<br> There is a key in your mailbox for the locker that has your package" emailbody = emailbody & ".<br> The locker number is " & locker End If If packagetype.ToString.Contains("Signature Waived") Then emailbody = emailbody & ".<br> Signature Waived the package is in your Mailbox" Else emailbody = emailbody & ".<br> Please bring your valid Gettysburg College ID.<br>" End If If noticelevel.Length > 0 Then emailbody = emailbody & ".<br> This is the " & noticelevel End If ''send the email Dim oMessage As New Net.Mail.MailMessage() oMessage.Subject = emailsubject oMessage.Body = emailbody oMessage.IsBodyHtml = True oMessage.From = New Net.Mail.MailAddress(emailfrom) oMessage.To.Add(New Net.Mail.MailAddress(email)) Dim client As New Net.Mail.SmtpClient(emailsmtpclient) If emailnetworkauthentication Then client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials Else Dim basicAuthenticationInfo As New System.Net.NetworkCredential(emailusername, emailpassword, emaildomain) client.Credentials = basicAuthenticationInfo End If client.Send(oMessage) oMessage.Dispose() End If Catch ex As Exception errorwrite("Email sent to:" & email & " Error String:" & ex.ToString & " Email Macro ") End Try
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.