Click here to Skip to main content
15,886,110 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Hijri calendar Pin
Abhijit Jana16-Dec-08 3:09
professionalAbhijit Jana16-Dec-08 3:09 
QuestionPrinter is not Detecting Pin
Exelioindia15-Dec-08 1:02
Exelioindia15-Dec-08 1:02 
AnswerRe: Printer is not Detecting Pin
Expert Coming16-Dec-08 17:19
Expert Coming16-Dec-08 17:19 
QuestionGridview pagging Pin
Hemant Thaker14-Dec-08 23:51
Hemant Thaker14-Dec-08 23:51 
AnswerRe: Gridview pagging Pin
Paddy Boyd15-Dec-08 2:35
Paddy Boyd15-Dec-08 2:35 
QuestionIn a loop Pin
mhh1214-Dec-08 12:37
mhh1214-Dec-08 12:37 
AnswerRe: In a loop Pin
Paddy Boyd15-Dec-08 2:37
Paddy Boyd15-Dec-08 2:37 
GeneralRe: In a loop Pin
mhh1217-Dec-08 8:40
mhh1217-Dec-08 8:40 
Ok, there is no loop in the code in the Basic programing technical sense. On the other hand why, after doing the End Sub of the Protected Sub Button1_click, does it go back to the first statement of the Protected Sub Button1_click procedure and proceed to do it all over again?

Here is a copy of the entire code behind page Page/History.aspx.vb. When I step through, statement by statement, it jumps over the Catch statements and does Finally and its statements and then End Try and then End Sub and then jumps to Protected Sub Button1_click, does the Dims and starts the Send Mail all over again.
I use ASP 3.5, Visual Web Developer Express 2008. The four Dims are there so I could be sure I picked up the four variables from the Display page. Once I know things are working correctly,

Much thanks for your help.

Imports System.Web.UI
Imports System
Imports System.Net
Imports System.Net.Mail
Imports System.Web.TraceContext


Partial Class Feedback
Inherits Page

Protected Sub Button1_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SenderName As String = TxtName.Text
Dim SendersEmail As String = TxtEmail.Text
Dim Subject As String = TextSubject.Text
Dim Message As String = TxtMessage.Text

SendMail(SenderName, SendersEmail, Subject, Message)

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


End Sub

Sub SendMail(ByVal SenderName As String, ByVal SendersEmail As String, ByVal Subject As String, ByVal Message As String)


Dim NetMail As New MailMessage
Dim MailClient As New SmtpClient

Dim ThisHost As String = "MAILSERVER"
Dim ThisPort As Integer = 25
Dim TheseCredentials As New NetworkCredential("USERNAME", "PASSWORD")

' Dim ThisSender As String = "SENDERNAME <RECIPIENTMAIL>"
Dim ThisSender As String = SenderName
' Dim ThisRecipient As String = "RECIPEINT MAIL <RECIPIENTMAIL>"
Dim ThisRecipient As String = "mhh112@hotmail.com"
' Dim ThisSilentRecipient As String = String.Empty

Try
' NetMail.From = New MailAddress(ThisRecipient)
NetMail.ReplyTo = New MailAddress(ThisRecipient)
NetMail.To.Add(New MailAddress(ThisRecipient))
' If Not ThisSilentRecipient = "" Then
' NetMail.Bcc.Add(New MailAddress(ThisSilentRecipient))
' End If
NetMail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
NetMail.IsBodyHtml = False
NetMail.Priority = MailPriority.Normal
' NetMail.Subject = "Test Subject" & DateTime.Now.ToLongTimeString()
NetMail.Subject = Subject & " " & DateTime.Now.ToLongTimeString()
' NetMail.Body = "Test Body " & DateTime.Now.ToLongTimeString()
NetMail.Body = DateTime.Now.ToLongTimeString() & " " & Message
MailClient.DeliveryMethod = SmtpDeliveryMethod.Network
' MailClient.Host = ThisHost
MailClient.Port = ThisPort
MailClient.UseDefaultCredentials = False
MailClient.Credentials = TheseCredentials
MailClient.Send(NetMail)


Catch EXC As Exception
Trace.Warn(EXC.Message)

Finally
NetMail.Dispose()
NetMail = Nothing
MailClient = Nothing
End Try
End Sub

Protected Sub TxtName_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)

End Sub

End Class
GeneralRe: In a loop Pin
Paddy Boyd17-Dec-08 22:07
Paddy Boyd17-Dec-08 22:07 
GeneralRe: In a loop Pin
mhh1218-Dec-08 13:29
mhh1218-Dec-08 13:29 
QuestionParser Error Message: Recursive fallback not allowed for character \u003F. [modified] Pin
Aman Bhullar13-Dec-08 21:48
Aman Bhullar13-Dec-08 21:48 
AnswerRe: Parser Error Message: Recursive fallback not allowed for character \u003F. Pin
Ellen Dhawan26-Jan-09 1:04
Ellen Dhawan26-Jan-09 1:04 
GeneralRe: Parser Error Message: Recursive fallback not allowed for character \u003F. Pin
Aman Bhullar27-Jan-09 5:06
Aman Bhullar27-Jan-09 5:06 
GeneralRe: Parser Error Message: Recursive fallback not allowed for character \u003F. Pin
Ellen Dhawan27-Jan-09 9:35
Ellen Dhawan27-Jan-09 9:35 
Questionproblem to display Chinese in Apache-Tomcat server Pin
alexyxj13-Dec-08 7:18
alexyxj13-Dec-08 7:18 
AnswerRe: problem to display Chinese in Apache-Tomcat server Pin
Paddy Boyd15-Dec-08 2:38
Paddy Boyd15-Dec-08 2:38 
QuestionExport data to outlook calander Pin
nainakarri12-Dec-08 17:41
nainakarri12-Dec-08 17:41 
AnswerRe: Export data to outlook calander Pin
Abhijit Jana12-Dec-08 22:53
professionalAbhijit Jana12-Dec-08 22:53 
GeneralRe: Export data to outlook calander Pin
nainakarri12-Dec-08 23:58
nainakarri12-Dec-08 23:58 
GeneralRe: Export data to outlook calander Pin
Perspx12-Dec-08 23:31
Perspx12-Dec-08 23:31 
GeneralRe: Export data to outlook calander Pin
nainakarri13-Dec-08 0:06
nainakarri13-Dec-08 0:06 
AnswerRe: Export data to outlook calander Pin
Sandeep Mewara4-Jan-09 22:47
mveSandeep Mewara4-Jan-09 22:47 
QuestionUrlRewriting conflicts with Lightbox Pin
razing12-Dec-08 5:41
razing12-Dec-08 5:41 
Question.htaccess bot protection rule Pin
GregStevens12-Dec-08 3:22
GregStevens12-Dec-08 3:22 
QuestionHow to insert data in GridView and then into database [modified] Pin
Member 400664811-Dec-08 18:34
Member 400664811-Dec-08 18:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.