Thanks for the reply. I have all of that formatting down as far as formatting of the message. The part that I am getting caught up on I think is the mail.to because I am calling a function.
In the function I see what option was selected from another drop down list on the form and then I just create a string with the email addresses concatinated with a ; if there is more than one. I think I am getting no message because I might be passing the wrong value. Unfortunately I don't have access to my code now because I'm at home and my project is at work but I will post the code snippit when I get to work on Monday.
ansalon5
Private Sub illMATC()
Dim strMATC As String
Dim strPickUp As String = lstPickup.SelectedValue
Dim strCampus As String
Dim strStatus As String = lstStatus.SelectedValue
Dim strEmail_Address As String
Dim strFullName As String = Name() 'txtName.Text
Dim strPhone As String = Phone() 'txtPhone.Text
Dim strEmail As String = Email() 'txtEmail.Text
Dim strPeriodicalTitle As String = Periodical() 'txtPedTitle.Text
Dim strArticleTitle As String = Article() 'txtArticleTitle.Text
Dim strAuthor As String = Author() 'txtAuthor.Text
Dim strPubDate As String = Published() 'txtPubDate.Text
Dim strVolume As String = Volume() 'txtVol.Text
Dim strPages As String = NumPages() 'txtPages.Text
Dim strDateNeeded As String = WhenNeeded() 'txtNeeded.Text
Dim strSubject As String = "I.L.L. Request"
End Sub
Private Sub CreateMessage(ByVal sender As System.Object, ByVal e As System.EventArgs, ByVal strFullName As String, ByVal strPhone As String, ByVal strEmail As String, ByVal strStatus As String, ByVal strPeriodicalTitle As String, ByVal strArticleTitle As String, ByVal strAuthor As String, ByVal strPubDate As String, ByVal strVolume As String, ByVal strPages As String, ByVal strDateNeeded As String, ByVal strPickUp As String, ByVal strEmail_Address As String, ByVal strSubject As String, ByVal strCampus As String)
Dim strTo As String = getEmpName(strEmail_Address, strCampus)
Dim MM As New System.Web.Mail.MailMessage ' Creates a new mail message
Dim message As System.Web.Mail.SmtpMail
Try
MM.Subject = strSubject
MM.To = strTo
MM.BodyFormat = MailFormat.Html ' Indicate Email is sent in HTML format.
MM.Priority = MailPriority.Normal
message.SmtpServer = "mail.matcmadison.edu"
txtMsgBody.Text = _
"<html>" & Chr(13) & Chr(10) & _
"<body bgcolor='#FFFFFF'>" & Chr(13) & Chr(10) & _
"<table>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>FullName:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Name() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>Phone:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Phone() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>Email:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Phone() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>Status:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Status() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>PeriodicalTitle:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Periodical() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>ArticleTitle:  </b></div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Article() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>Author:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Author() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>PubDate:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Published() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>Volume:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Volume() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>Pages:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & NumPages() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>DateNeeded:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & WhenNeeded() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
" <tr>" & Chr(13) & Chr(10) & _
" <td><div align='right'><b>PickUp:  </b> </div></td>" & Chr(13) & Chr(10) & _
" <td><div align='left'> " & Campus() & "</div></td>" & Chr(13) & Chr(10) & _
" </tr>" & Chr(13) & Chr(10) & _
"</table>"
MM.Body = txtMsgBody.Text
message.Send(MM)
Catch ex As Exception
Response.Write("Error encountered: " & ex.ToString)
End Try
End Sub
Private Function getEmpName(ByVal strEmail_Address As String, ByVal strCampus As String) As String
Dim strTo As String
If strCampus = "Downtown" Then
strEmail_Address = "
[email protected]"
'strEmail_Address = "
[email protected]"
strTo = strEmail_Address
ElseIf strCampus = "Fort Atkinson" Then
strEmail_Address = "
[email protected]"
strTo = strEmail_Address
strEmail_Address = "
[email protected]"
strTo += "; " & strEmail_Address
strEmail_Address = "
[email protected]"
strTo += "; " & strEmail_Address
ElseIf strCampus = "Portage" Then
strEmail_Address = "
[email protected]"
strTo = strEmail_Address
strEmail_Address = "
[email protected]"
strTo += "; " & strEmail_Address
ElseIf strCampus = "Reedsburg" Then
strEmail_Address = "
[email protected]"
strTo = strEmail_Address
strEmail_Address = "
[email protected]"
strTo += "; " & strEmail_Address
ElseIf strCampus = "Truax" Then
strEmail_Address = "
[email protected]"
strTo = strEmail_Address
strEmail_Address = "
[email protected]"
strTo += "; " & strEmail_Address
ElseIf strCampus = "Watertown" Then
strEmail_Address = "
[email protected]"
strTo = strEmail_Address
strEmail_Address = "
[email protected]"
strTo += "; " & strEmail_Address
End If
Return strTo
End Function