I have a very simple question from a VERY inexperianced user I have a web application with DASP and I want to allow my customers to send "Contact Us" emails to my Smart Mail account at DASP. Can I do this in my local development enviorment (While debuging) without a local Mail Client present ? Hope my question is clear I tried to keep the question a simple as possible! albanello
You can relay mail from your local computer, but odds are it will be flagged as spam along the way and rejected (or accepted but not delivered). A lot of spam used to (and probably still does) originate from compromised home computers, so networks, mail servers and spam filters have adapted to reject those kinds of messages. So while it may be technically possible, it would be problematic and probably not worth the effort to set up.
The answer to MY simple question is: A local client email program is NOT required on your local debug computer ! For anybody that is interested after a lot of trial and error and patching misc stuff togeather with bubble gum this finally worked for me. Here is the code that worked for me ******** Dim strFrom = "FromEmailAddress.com" Dim strTo = "YourSmartMailEmailAddress.com" Dim MailMsg As New MailMessage(New MailAddress(strFrom.Trim()), New MailAddress(strTo)) MailMsg.BodyEncoding = Encoding.Default MailMsg.Subject = "ASP.NET e-mail test" MailMsg.Body = "Hello world,\n\nThis is an ASP.NET test e-mail!" MailMsg.Priority = MailPriority.High MailMsg.IsBodyHtml = True 'Smtp client to send the mail message Dim SmtpMail As New SmtpClient("smtp.YourSmartMailEmailAddress.com", 587) SmtpMail.Credentials = New System.Net.NetworkCredential("YourSmartMailEmailAddress.com", "YourSmartMailPassword") SmtpMail.Send(MailMsg) ******** Hope this helps somebody! I think I'm going to try and see if there is a way to put the YourSmartMailEmailAddress.com", "YourSmartMailPassword" in the "web.config" file DO NOT know how to do this, if somebody out there could send the syntax to do it I would appreciate very much albanello
MJP My previous post show how I got the EMail in my Smart Mail account from my local debug environment........are you saying I should not do it this way ???????? albanello
If you want to place the settings in your web.config file, please see the following links: https://msdn.microsoft.com/en-us/library/w355a94k(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/ms164240(v=vs.110).aspx
RayH Thanks for the 2 links........I looked at them and will have to study them before I can attempt the implementation. It was kind of late when I looked at them so hopefully today I will be able to understand and implement the "web.config" modification Thanks again albanello