I want to receive email to my email address through my asp.net application. Its like someone who send an inquiry through a form. I have used the following code for this and seems like its doing nothing. I remember that I did one of my websites and cant remember how I did it. Please find the code below.
Thanks,
eMessage.To = "[email protected]"
eMessage.From = txtEmail.Text
eMessage.Subject = "Web Submission"
eMessage.Body = "Web submission received from " & txtName.Text & ". Phone no: " & txtPhone.Text & "."
eMessage.Priority = MailPriority.High
SmtpMail.Send(eMessage)
How can I make this working?
Your sample code shows how to use SMTP to send emails, but you won't be able to retrieve emails from a remote server using this protocol.
The two most common protocols used to retrieve emails are POP3 and IMAP4, and unfortunately the .NET framework doesn't provide an implementation of them like it is done with SMTP.
One option for email retrieval is to use use the open source POP3 client OpenPop.NET, which is discussed in this SO question: retrieve email using c#?.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With