Showing posts with label manage. Show all posts
Showing posts with label manage. Show all posts

Friday, March 16, 2012

news website

I am going to run an website publishing news and article. I would like to be able to MANAGE articles accoring to their topic and time. I would like to know if :
1) Is there any software to do that work
2) Database can store short text ( at least what I have been working with, less than 60 characterBig Smile [:D]) but is it possible to store the whole article as an entry in database.
3) If both answer to 1 and 2 is NO, what is the common way that website like what I am intending to run would do.
Regards.

umala wrote:

2) Database can store short text ( at least what I have been working with, less than 60 characterBig Smile [:D]) but is it possible to store the whole article as an entry in database.


I'm not sure about software that will do this for you, but you can use a SQL Server database to store your articles depending on the length. Using the varchar datatype you can store anything from 1 to 8000 characters. If your articles will fit within this range, this would be the best solution because you can add columns for both topic and time or date, which you can then sort them through your database query.
Hope this helps somewhat,
smtraber

Newsletter

How to create newsletter in asp.net 2.0?
How to manage email list?
how can user subscribe and unsubscribe?

Hi,
- all kinds of questions about emailing from .NET can be found here:http://www.systemwebmail.com.
- to manage a list of subscribers you could use a webform with a grid on it.
- you can have a page where a person can subscribe. In ASP.NET 2.0 the CreateUserWizard would be a nice control to take a look at for this purpose. After that you can send a confirmation email to make sure that the person who subscribed really owns that emailaddress.
Grz, Kris.


is it possible to create newsletter using any html editor and use that page in your asp.net so that you dont have to write all the html code in asp.net.


Hi,
you could that,read it out using a streamreader and use it to fill up the body of the mail message. Another way could be that you use atext editor like where you type in your questions on this forum and save it into a database. It seems handier to me to do so because you don't have to make up any html and upload it to a server.
Grz, Kris.
That helps. you have any example I can check online.
Hi,
you want an example for...?
If you want to put something into a database you'll be needingADO.NET. The freetextbox I mentioned in my previous post is a free webcontrol that you can download and use. The link to the "reading text from a file" in my previous post shows you how to use the StreamReader class to read from a file.
Grz, Kris.
I tried the below code and it just sends me an blank email. newsletter.htm is a html page with simple newsletter. I also had to put full path for this. I tried "./images/newsletter.htm" and it ended up with error ( cannot find newsletter.htm in c:\windows\system32).
What am I doing wrong here?
Private Const FILE_NAME As String = "C:\Inetpub\wwwroot\Intranet\images\newsletter.htm"
Dim email As MailMessage
If Not File.Exists(FILE_NAME) Then
Console.WriteLine("{0} does not exist.", FILE_NAME)
Return
End If
Dim sr As StreamReader = File.OpenText(FILE_NAME)
Dim input As String
input = sr.ReadLine()
Dim strnews As String
SmtpMail.SmtpServer = "localhost"
email = New MailMessage
email.BodyFormat = MailFormat.Html
email.From =emailme@.email.com
email.To = ("emailme@.email.com")
email.Subject = "News Letter"
While Not input Is Nothing
input = sr.ReadLine()
strnews = input
End While

Hi,
at first glance you missed a property of the MailMessage class:Body. Besides that your code doesn't seem quite clean to me.

While Not input Is Nothing
input = sr.ReadLine()
strnews = input
End While
Why do you assign a string to another string? Also it would be better to write it like this:
strnews += input so you concatenate the strings, now you're just simply replacing them.
Another thing, and even more important, is the fact that you use simple strings to concatenate. This can be done as long as the concatenating doesn't take more than 5 times. Because a string is immutable, every time you concatenate a new string is created. So it's better to use aStringBuilder instance in this case.
So it would be more like this:

Dim sr As StreamReader = File.OpenText(FILE_NAME)
Dim input As New StringBuilder()
SmtpMail.SmtpServer = "localhost"
email = New MailMessage
email.BodyFormat = MailFormat.Html
email.From = emailme@.email.com
email.To = ("emailme@.email.com")
email.Subject = "News Letter"
String strNews
Do strNews = sr.ReadLine()
input.Append(strNews)
Loop Until line Is Nothing
sr.Close()
email.Body = input.ToString()
This code isn't tested and I didn't have any coffee yet.
Grz, Kris.


Hi
Prevent potentially dangerous HTML Tags:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000004.asp
Regards

I want to start with a simple newsletter. First step I want to send out and HTML page. When I try that, it does not display any pictures when viewed in email. Any better way to work on this.
Dim strnewsAsString

SmtpMail.SmtpServer = "w2k3-exch1.360incliv.com"

email =New MailMessage

email.BodyFormat = MailFormat.Html

email.From = "bpatel@.360inc.com"

email.To = ("bpatel@.360inc.com")

email.Subject = "News Letter"

Dim attachmentAsNew MailAttachment(Server.MapPath("newsletter.htm"))'create the attachment

email.Attachments.Add(attachment)'add the attachment

SmtpMail.Send(email)