View Full Version : Mailinglist/autoresponder
Malin
04-14-2004, 05:45 AM
Hi
Is there a way to set up a mailinglist in asp.net? I want to add mail addresses to a database and then I want them to get a copy of each message sent to a specific mail address. It is not just a "one way communication" like a newslist. Communication goes in two directions and what I dont understand is how to recieve an e-mail from asp.net code and then pass it on to all the subscribers to the mailinglist (listed in my database).
Is this possible?
Malin
04-15-2004, 01:15 AM
Thanks for your answer Bruce [:)]
Do you mean that I in my asp.net code should check a pop3 account for new e-mails and if there is one pass it on to my subscribers?
Do you know how much bandwidth about 70 mails a day * about 60 members would require in a month?
If so, then I have to use the scheduled task to execute the code checking for new mails..or?
I have read more about this now and I understand that what I need is listserver functionality where all members of the list post their mails to, lets say list@list.com. All mails posted to list@list.com are then bounced to all members.
Do you think it would be worth a try if (when [8D]) I sort out the code you gave me and combine this somehow with the scheduled task?
Malin
Malin
04-15-2004, 02:42 AM
Sorry that I called you Bruce Scott [:I]
Scott
04-15-2004, 11:23 AM
Malin,
Here are a few functions using the aspNet email component that is installed on DASP. Hopefully, they will be sufficient to point you in the right direction.
<%@ Import Namespace="aspNetMime" %>
<%@ Import Namespace="aspNetMX" %>
<%@ Import Namespace="aspNetPop3" %>
<%@ Import Namespace="aspNetEMail" %>
<script language="vb" runat="server">
dim mailserver as string = "mail.MyWebSiteName.com" ' ***** CHANGE TO YOUR INFO *****
dim mailaccount as string = "AccountName@MyWebSiteName.com" ' ***** CHANGE TO YOUR INFO *****
dim mailpassword as string = "MyPassword" ' ***** CHANGE TO YOUR INFO
dim pop as new POP3(MailServer, MailAccount, MailPassword)
dim LastMessageDistributed as integer = 0
dim RecipientList as string = ""
dim DistributedMessageList as string = "0"
'------------------------------------------------
sub DeleteNMessagesFromInbox(pop as pop3, n as integer)
'--deletes all messages in the inbox of the specified pop account from the first message through message n
dim i as integer
pop.connect()
for i = 0 to Getn -1
pop.delete(i)
next
pop.CommitDeletes()
pop.Disconnect()
end sub
'------------------------------------------------
function GetInboxMessageCount(pop As POP3) as integer
'--gets the number of messages currently in the specied pop account inbox
dim Messages as integer
pop.connect()
pop.PopulateInboxStats()
messages = pop.InboxMessageCount
pop.disconnect()
return Messages
end function
'------------------------------------------------
function GetMessagesDataTable(pop as POP3, optional FirstMessage as integer = 0, optional LastMessage as integer = -1) as System.Data.DataTable
'--returns a data table containing the specified range of messages from the inbox
pop.Connect()
dim dt as system.data.DataTable = pop.MessageTable(FirstMessage, LastMessage)
pop.Disconnect()
return dt
end function
</script>
vBulletin® ©Jelsoft Enterprises Ltd.