Mailing System

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • palanivel
    New Member
    • Jun 2007
    • 30

    #1

    Mailing System

    hi frinendz,

    how to create the mail project.


    i am senting the mail throw .net (c# asp)
  • vinci
    New Member
    • Aug 2006
    • 62

    #2
    Originally posted by palanivel
    hi frinendz,

    how to create the mail project.


    i am senting the mail throw .net (c# asp)
    try to search the web (google, yahoo) fro the answer

    type in "how to email with c#.net and asp.net"
    hope ull find answers there...

    enjoy coding,
    vinci

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      Please be more specific. What are the requirements? What have you tred so far? Did you receive any error messages?

      Comment

      • palanivel
        New Member
        • Jun 2007
        • 30

        #4
        Originally posted by kenobewan
        Please be more specific. What are the requirements? What have you tred so far? Did you receive any error messages?

        i am didn't write the code .how to start the C#asp.net coding.

        mailing system for example i will sent the mail throw smtp via .how to write the code

        pls reply me.......

        Comment

        • vinci
          New Member
          • Aug 2006
          • 62

          #5
          i understand that u stil dont have any written codes...

          try this link,



          try to study the codes...

          enjoy!

          -vinci

          Comment

          • palanivel
            New Member
            • Jun 2007
            • 30

            #6
            Originally posted by vinci
            i understand that u stil dont have any written codes...

            try this link,



            try to study the codes...

            enjoy!

            -vinci
            hi friend the document didnot open.

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              Hi,

              Have you seen this .NET Article on how to send an email?

              It is strongly recommended that you actually try to create the application before asking questions. Vague questions are very hard to answer.

              If you start by trying to send an email, as described by that article, and then get back to us with more specific questions on the problems you're encountering we will be able to better help you.

              (I realize that the article is written for VB.NET applications. But you should be able to easily use it in your C# application with a few syntactical changes. )

              -Frinny

              Comment

              • palanivel
                New Member
                • Jun 2007
                • 30

                #8
                Website

                hi friends ,


                i am creating mailing system using the code






                Imports System.Net.Mail .MailAddress
                'Imports System.Web.Mail .MailFormat
                'Imports System.Web.Mail .MailMessage
                Imports System.Net.Mail .MailMessage
                Imports System.Net.Mail .SmtpClient
                Imports System.Net.Mail .MailPriority
                Imports System.Net.Mail .Attachment

                Partial Class _Default
                Inherits System.Web.UI.P age
                Dim sTo As String, sFrom As String, sSubject As String, sBody As String
                Dim sAttach As String, sCc As String, sBcc As String, sBodyEncoding As String
                Dim sBodyFormat As String, sMailServer As String, sPriority As String
                Dim sUrlContentBase As String, sUrlContentLoca tion As String
                Dim iLoop1 As Integer


                Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s) Handles Me.Load
                Dim Encoding As New System.Net.Mail .MailMessage

                If Not IsPostBack Then
                lblMsg1.Text = ""
                txtTo.Text = "palanivels@red iffmail.com.com "
                txtFrom.Text = "marsha@contoso .com"
                txtCc.Text = "fred@contoso.c om"
                txtBcc.Text = "wilma@contoso. com"
                txtSubject.Text = "Hello"
                txtBody.Text = "This is a test message."
                'txtAttach.Text = "C:\Documen ts and Settings\All Users\Documents \My Pictures\Sample Pictures\Sunset .jpg," _
                ' & "C:\Documen ts and Settings\All Users\Documents \My Pictures\Sample Pictures\Winter .jpg"
                ' txtBodyEncoding .Text = Encoding.ASCII. EncodingName
                txtBodyFormat.T ext = "HTML"
                txtPriority.Tex t = "Normal"
                txtUrlContentBa se.Text = "http://www.contoso.com/images"
                txtUrlContentLo cation.Text = "http://www.contoso.com/images"
                ' Name of relay mail server in your domain.
                txtMailServer.T ext = "smarthost" '
                End If

                End Sub

                Protected Sub Button1_Click(B yVal sender As Object, ByVal e As System.EventArg s) Handles Button1.Click
                Dim sTo As String, sFrom As String, sSubject As String, sBody As String
                Dim sAttach As String, sCc As String, sBcc As String, sBodyEncoding As String
                Dim sBodyFormat As String, sMailServer As String, sPriority As String
                Dim sUrlContentBase As String, sUrlContentLoca tion As String
                ' Dim iLoop1 As Integer


                sTo = Trim(txtTo.Text )
                sFrom = Trim(txtFrom.Te xt)
                sSubject = Trim(txtSubject .Text)
                sBody = Trim(txtBody.Te xt)

                sAttach = Trim(txtAttach. Text)
                sCc = Trim(txtCc.Text )
                sBcc = Trim(txtBcc.Tex t)
                sBodyFormat = Trim(txtBodyFor mat.Text)
                sBodyEncoding = Trim(txtBodyEnc oding.Text)
                sPriority = Trim(txtPriorit y.Text)
                sUrlContentBase = Trim(txtUrlCont entBase.Text)
                sUrlContentLoca tion = Trim(txtUrlCont entLocation.Tex t)
                sMailServer = Trim(txtMailSer ver.Text)

                Dim MyMail As Mail.MailMessag e = New Mail.MailMessag e
                MyMail.From = sFrom
                MyMail.To = sTo
                MyMail.Subject = sSubject
                MyMail.Body = sBody
                MyMail.Cc = sCc
                MyMail.Bcc = sBcc
                MyMail.UrlConte ntBase = sUrlContentBase
                MyMail.UrlConte ntLocation = sUrlContentLoca tion

                Select Case txtBodyEncoding .Text
                Case Encoding.UTF7.E ncodingName : MyMail.BodyEnco ding = Encoding.UTF7
                Case Encoding.UTF8.E ncodingName : MyMail.BodyEnco ding = Encoding.UTF8
                Case Else : MyMail.BodyEnco ding = Encoding.ASCII
                End Select

                Select Case UCase(sBodyForm at)
                Case "HTML" : MyMail.BodyForm at = Mail.MailFormat .Html
                Case Else : MyMail.BodyForm at = Mail.MailFormat .Text
                End Select

                Select Case UCase(sPriority )
                Case "HIGH" : MyMail.Priority = Mail.MailPriori ty.High
                Case "LOW" : MyMail.Priority = Mail.MailPriori ty.Low
                Case Else : MyMail.Priority = Mail.MailPriori ty.Normal
                End Select

                'Build an IList of mail attachments.


                If sAttach <> "" Then
                Dim delim As Char = ","
                Dim sSubstr As String
                For Each sSubstr In sAttach.Split(d elim)
                Dim myAttachment As Net.Mail.Attach ment = New Net.Mail.Attach ment(sSubstr)
                MyMail.Attachme nts.Add(myAttac hment)
                Next
                End If

                Mail.SmtpMail.S mtpServer = sMailServer
                Mail.SmtpMail.S end(MyMail)

                lblMsg1.Text = "VB Message sent to " & MyMail.To

                End Sub
                End Class


                those programming error :The transport failed to connect to the server.

                how to solve the error


                pls reply me........

                Comment

                • kenobewan
                  Recognized Expert Specialist
                  • Dec 2006
                  • 4871

                  #9
                  This is a network related error. Your application cannot connect to the mail server specified.

                  SmtpMail.SmtpSe rver
                  Is a valid SMTP Server?

                  Check to be sure the server System.Web.Mail is executing on can connect to the mail server. Some times firewalls or proxy servers can get in the way.
                  Try specifying the value by IP address. Poor DNS resolution can sometimes hinder name lookups.

                  Make sure the that the mail server is running at port 25.

                  If you did not specify a SmtpMail.SmtpSe rver property, or if SmtpMail.SmtpSe rver points to "localhost" (or the equivalent), be sure the SMTP Service is running on port 25.

                  For testing purposes change the MailMessage.Fro m and MailMessage.To properties to an address that exists on SmtpMail.SmtpSe rver. Some times this exception is thrown, when it really is a relay issue.

                  Comment

                  • palanivel
                    New Member
                    • Jun 2007
                    • 30

                    #10
                    WebSite

                    hi,


                    how to send the mail from C# ASP.NET coding pls reply me........

                    Comment

                    • palanivel
                      New Member
                      • Jun 2007
                      • 30

                      #11
                      WebSite

                      hi,


                      how to send the mail from C# ASP.NET coding pls sent me a coding very urgent......... ...........

                      Comment

                      • dip_developer
                        Recognized Expert Contributor
                        • Aug 2006
                        • 648

                        #12
                        Originally posted by palanivel
                        hi,


                        how to send the mail from C# ASP.NET coding pls sent me a coding very urgent......... ...........
                        why are you so reluctant to search for a article in NET????? There are whole lot of resources....

                        please give it a look.....

                        eSports News, Results, upcoming Matches & live Matches. Learn tricks and guides in the esports space. ✅ We cover CS:GO, Dota 2, LOL, Overwatch & PUBG. 




                        http://www.sitepoint.com/article/sen...-email-asp-net

                        Comment

                        • kenobewan
                          Recognized Expert Specialist
                          • Dec 2006
                          • 4871

                          #13
                          Here is an article that may help:
                          Send Email in ASP.Net 2.0 - Feed back Form

                          Comment

                          Working...