|
Then I guess you found where to put it ? You need an actual mail server, in order to send mail.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yeah, thanks.
Why is everyone mentioning 'localhost' if it's not a vaible option i wonder? Can I just use any server until I put it live?
Thanks
|
|
|
|
|
It's possible to set up a mail server on our local machine. You can put whatever you like, but it won't work, obviously.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm not sure how it can be tested then without putting it live, that cannot be right surely?
|
|
|
|
|
How do you hope to send mail, without a mail server ? You cannot. I don't see the issue, your mail server is not 'live', it's the server that sends your mail ( i.e. you can use the mail server from your ISP, the one that your Outlook uses ).
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Just for testing purpose you can use localhost as server and delivery method as Pickup directory. So all the mails sent are kept in pickup directory as outlook file format. You can goto that directory and easily check the mail. Once you are ready to release the application, change delivery method to Network and specify valid SMTP server details and credentials. Read details about SMTPClient here[^]. Read and excellent FAQ on System.Net.Mail here[^]. Also this[^] explains how to configure your application configuration file.
|
|
|
|
|
Thank you, I thought it was possible. many thanks again....
|
|
|
|
|
|
I have a working version of an email client I made using smtp for C#. If you still need it, I can send you my sample code. As well, I would like to tell you that the server you are using is also important. I'm going to presume that you are going to use a free server, so your best bet would most likely be using Googlemail's smtp, since you actually forward your mail to their ports. As well, what you had before was to simple a method, if you're using an smtp server, you're going to have to authenticate each request, meaning that you'll also have to send your email's password.
|
|
|
|
|
hi all,
Nw i need to create a custom regular expression for validating the string [Select]
plz help....
regards,
syamooo...
|
|
|
|
|
"[Select]"
A regex can be anything you like, that is, there are many ways to match that string. The real question is, how closely do you need to match it, and what other strings would be OK ? Expresso is a tool you should download to help you learn regex
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
What string do you want to validate for what values?
This ^ gave me loads of answers in seconds.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello everyone,
I need to generate some XML message, but the message can not be reflected from members or properties of class instance directly.
Currently, I am using StringBuilder to append strings into XML message manually (e.g. to generate the element's hierarchies and add attributes to element), I think this method is stupid.
Any better approaches recommended?
thanks in advance,
George
|
|
|
|
|
XMLDocument can be better than StringBuilder...
|
|
|
|
|
Thanks natsuyaki,
1.
I read some documents for XMLDocument and XMLElement, looks like we need to use DOM model, right?
2.
I have not found some good samples for a beginner, I have XML knowledge before and just want to learn how to use the C# classes. Any referred samples?
regards,
George
|
|
|
|
|
George_George wrote: looks like we need to use DOM model, right?
Yes. XMLDocument use DOM. When file is loaded, it loads the entire file into memory. So if the file is very large, this method is inefficient. Calling Save() method on this class instance will save all the changes made to the instance.
George_George wrote: Any referred samples?
I think MSDN has enough documentation on using these classes. It's pretty easy.
|
|
|
|
|
Thanks N a v a n e e t h,
XMLTextWriter will not use DOM model and only loads necessary nodes other than all nodes (which is done in DOM model)?
regards,
George
|
|
|
|
|
George_George wrote: XMLTextWriter will not use DOM model and only loads necessary nodes other than all nodes
XMLTextWriter won't load any nodes. It is used to create XML documents. It has some methods which you can use to create nodes, attributes etc.
|
|
|
|
|
Sorry, N a v a n e e t h!
My bad, I mean XMLTextReader, it will not load the entire tree as DOM, like XMLDocument, and it will only loads necessary nodes, right?
regards,
George
|
|
|
|
|
Yes. It will not load the full file initially. XMLDocument class is also using a reader internally to fill the data.
|
|
|
|
|
Thanks N a v a n e e t h,
1.
So, can I understand that using XMLDocument has better performance compared with XMLTextReader, but bigger memory footprint.
2.
XMLDocument can both read/write, but XMLTextReader can only read, and XMLTextWriter can only write?
regards,
George
|
|
|
|
|
George_George wrote: So, can I understand that using XMLDocument has better performance compared with XMLTextReader, but bigger memory footprint.
This depends on the XML file size. When you call Load() method in an XMLDocument classes instance, it reads all the nodes and forms a DOM and keeps in the memory. So when the file is huge, it will consume more memory.
Performance is dependent of your scenario. If you need to read the XMLFile (not as DOM), XMLTextReader will give good performance. For creating a new xml file, XMLTextWriter will give good performance. Say, in a situation where you will add new nodes, change the attributes, and doing some XPath queries, then better choice would be XMLDocument class.
George_George wrote: XMLDocument can both read/write, but XMLTextReader can only read, and XMLTextWriter can only write?
XMLDocument class can do more than read/write. It supports XPath queries also.
|
|
|
|
|
Great N a v a n e e t h!
If I only need to read XML documents (in a file) into memory and get some values for some elements, then I think using XMLDocument will always have better performance, since all nodes are in memory (compared with XMLTextReader, only parts of nodes are in memory). Why do you think it is not always true?
regards,
George
|
|
|
|
|
George_George wrote: If I only need to read XML documents (in a file) into memory and get some values for some elements, then I think using XMLDocument will always have better performance
If the file size is less, you won't find any performance differences. XMLDocument provides an easy way to load and edit data. You can go with any methods which really suits your scenario.
|
|
|
|
|
Thanks N a v a n e e t h,
If the size of file is big, using XMLDocument is of better performance?
regards,
George
|
|
|
|