![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Send e-mails with a webform Hi group, I have the following code: It works fine, but I want to use another smtp server and it use the TCP Port 5000 There is a way to change the default smtp port (25) with aditional code? Thanks in advance. Imports System.Web.Mail Partial Class AddCasos Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim mailMessage As New MailMessage() mailMessage.From = TextBox1.Text mailMessage.To = soporte@xxxxxx mailMessage.Subject = TextBox2.Text mailMessage.BodyFormat = MailFormat.Text mailMessage.Body = TextBox3.Text mailMessage.Priority = MailPriority.Normal SmtpMail.SmtpServer = "server05" 'mail server used to send this email. modify this line based on your mail server SmtpMail.Send(mailMessage) Response.Redirect("casesend.aspx") End Sub End Class |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Send e-mails with a webform If you implement my "Smarter SMTP Settings" solution, you won't get screwed with different environments: http://sholliday.spaces.live.com/Blo...842A!138.entry But no, you have to set the System.Net.Mail.SmtpClient.Port property (2.0) Or in 1.1 MailMessage emailMsg = new MailMessage(); emailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", portNum); That's why my Wrapper Stuff is "smarter". "Esteban GN" <egnra@xxxxxx> wrote in message news:Ob2kxBdPJHA.588@xxxxxx Quote: > Hi group, > I have the following code: > It works fine, but I want to use another smtp server and it use the TCP > Port 5000 > There is a way to change the default smtp port (25) with aditional code? > Thanks in advance. > > > Imports System.Web.Mail > > Partial Class AddCasos > > Inherits System.Web.UI.Page > > Protected Sub Button1_Click(ByVal sender As Object, ByVal e As > System.EventArgs) Handles Button1.Click > > Dim mailMessage As New MailMessage() > > mailMessage.From = TextBox1.Text > > mailMessage.To = soporte@xxxxxx > > mailMessage.Subject = TextBox2.Text > > mailMessage.BodyFormat = MailFormat.Text > > mailMessage.Body = TextBox3.Text > > mailMessage.Priority = MailPriority.Normal > > SmtpMail.SmtpServer = "server05" > > 'mail server used to send this email. modify this line based on your mail > server > > SmtpMail.Send(mailMessage) > > Response.Redirect("casesend.aspx") > > End Sub > > End Class > > > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Send e-mails with a webform Thank you! It works fine. KR "sloan" <sloan@xxxxxx> escribió en el mensaje news:Ol1YfafPJHA.4576@xxxxxx Quote: > If you implement my "Smarter SMTP Settings" solution, you won't get > screwed with different environments: > > http://sholliday.spaces.live.com/Blo...842A!138.entry > > > But no, you have to set the > System.Net.Mail.SmtpClient.Port > property (2.0) > > > Or in 1.1 > MailMessage emailMsg = new MailMessage(); > emailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", > portNum); > > > That's why my Wrapper Stuff is "smarter". > > > > > > "Esteban GN" <egnra@xxxxxx> wrote in message > news:Ob2kxBdPJHA.588@xxxxxx Quote: >> Hi group, >> I have the following code: >> It works fine, but I want to use another smtp server and it use the TCP >> Port 5000 >> There is a way to change the default smtp port (25) with aditional code? >> Thanks in advance. >> >> >> Imports System.Web.Mail >> >> Partial Class AddCasos >> >> Inherits System.Web.UI.Page >> >> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As >> System.EventArgs) Handles Button1.Click >> >> Dim mailMessage As New MailMessage() >> >> mailMessage.From = TextBox1.Text >> >> mailMessage.To = soporte@xxxxxx >> >> mailMessage.Subject = TextBox2.Text >> >> mailMessage.BodyFormat = MailFormat.Text >> >> mailMessage.Body = TextBox3.Text >> >> mailMessage.Priority = MailPriority.Normal >> >> SmtpMail.SmtpServer = "server05" >> >> 'mail server used to send this email. modify this line based on your mail >> server >> >> SmtpMail.Send(mailMessage) >> >> Response.Redirect("casesend.aspx") >> >> End Sub >> >> End Class >> >> >> >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Cannot Send E-mails- Error Message Recieved- Can recieve e-mails | Vista mail | |||
| unable to send out e-mails through Windows Mail, incoming mails ar | Vista mail | |||
| Cannot recieve e-mails, but can send e-mails | Vista mail | |||
| Prevent multi-submit on webform for user refresh action? | .NET General | |||