Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 5th, 2006, 09:25 AM
Authorized User
 
Join Date: Sep 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Email in asp.net

Hi,
I am making an email group like yahoo or msn groups in asp.net, in which i want to receive email from any where and then i want to send it to all user which are in group and also display the email at group's page how i can do this please help,
thanks in advance

asif
__________________
asif
 
Old January 5th, 2006, 01:35 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

There are plenty of examples on line if you just take the time to search a little. Once you have tried something and are having problems, then we can help.

 
Old January 6th, 2006, 10:23 AM
Authorized User
 
Join Date: Sep 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your suggestion but if you can sent me some links i will very thankful to you

asif
 
Old February 23rd, 2006, 07:05 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
I am new to this forum & asp.net.
Iam trying to write a web-based application to read my emails through webpage(pop account). I had done this in ASP using CDO session.
Now what i thought is we can do this much easily in ASP.NET(System.Web.mail), however this turned false. I tried system.net through which i could get the no of emails etc. But i cannot see or display the messages in the browser or can say cannot extract the body of the message.So can anybody help me on that.I do not want to use any commercial components.

THE CODE I AM USING GOT THROUGH SOME WEBSITE works well
Code:
Imports System
Imports System.Text
Imports System.Net
Public Class email
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region
    Private tcpC As New Sockets.TcpClient
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ReadMail("mail.calorisplanitia.com", "[email protected]", "password")
    End Sub

    ' send command strings and return the response
    Function SendCommand(ByRef netstream As System.Net.Sockets.NetworkStream, ByVal sToSend As String)
        Dim bData() As Byte = Encoding.ASCII.GetBytes(sToSend.ToCharArray)
        netstream.Write(bData, 0, bData.Length())
        Return GetResponse(netstream)
    End Function

    ' check if there is a response to get and return it
    Function GetResponse(ByRef netstream As System.Net.Sockets.NetworkStream)
        Dim bytes(tcpC.ReceiveBufferSize) As Byte
        Dim ret As Integer = netstream.Read(bytes, 0, bytes.Length)
        ' Returns the data received
        Dim returndata As String = Encoding.ASCII.GetString(bytes)
        Return returndata
    End Function
    Function ReadMail(ByVal host As String, ByVal user As String, ByVal pass As String)
        ' initialise objects
        Dim netstream As System.Net.Sockets.NetworkStream
        Dim thisResponse As String
        ' open connection to server
        Try
            tcpC.Connect(host, 110)
        Catch ex As Exception
            Response.Write("Error connecting to host: " & ex.Message & " - Please check your details and try again")
            Response.End()
        End Try
        ' get response
        netstream = tcpC.GetStream()
        thisResponse = GetResponse(netstream)
        ' enter user name
        thisResponse = SendCommand(netstream, "user " & user & vbCrLf)
        ' enter password
        thisResponse = SendCommand(netstream, "pass " & pass & vbCrLf)
        ' check if logged in ok
        If Not Left(thisResponse, 4) = "-ERR" Then
            Response.Write("Logged in OK <BR>")
        Else
            Response.Write("Error logging in, check your user details and try again<BR>")
            Response.Write("<P>" & thisResponse & "</p>")
            Response.End()
        End If
        thisResponse = SendCommand(netstream, "stat" & vbCrLf)
        Dim tmpArray() As String
        tmpArray = Split(thisResponse, " ")
        Dim thisMess As Integer
        Dim numMess As String = tmpArray(1)
        Response.Write("")
        thisResponse = ""
        If CInt(numMess) > 0 Then
            Response.Write("Messages: " & numMess & "<br>")
            For thisMess = 1 To CInt(numMess)
                thisResponse += Replace(SendCommand(netstream, "top " & thisMess & " 10" & vbCrLf), vbCrLf, "<br>")
            Next
        Else
            Response.Write("Messages: None" & "<br>")
        End If
        thisResponse += Replace(SendCommand(netstream, "stat" & vbCrLf), vbCrLf, "<br>")
        tmpArray = Split(thisResponse, "+OK")
        Response.Write(thisResponse & "<br>--------------------------------------------<br>")
        Dim msg As Integer
        For msg = 1 To tmpArray.Length - 1
            Response.Write("<h3>#" & msg & "</h3><pre>" & tmpArray(msg) & "</pre>")
        Next
        ' close connection
        thisResponse = SendCommand(netstream, "QUIT" & vbCrLf)
        tcpC.Close()
    End Function
End Class
 
Old September 21st, 2006, 07:31 AM
Authorized User
 
Join Date: Sep 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How to get addresses in contacts..using this code






Similar Threads
Thread Thread Starter Forum Replies Last Post
Email in ASP.NET Manoj Bisht ASP.NET 1.0 and 1.1 Professional 1 September 28th, 2007 07:57 AM
How to Sending an email in asp.net 2.0 using C# Bashu C# 2005 4 August 14th, 2007 03:29 AM
Email in asp.net asif_sharif ASP.NET 1.0 and 1.1 Basics 0 January 3rd, 2006 11:48 AM
the email of asp.net calvinpost ASP.NET 1.x and 2.0 Application Design 3 March 28th, 2004 09:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.