Hope someone may be able to help. What i am looking to do is create a small winform app in c# to read the content of a email from a pop account, and upload key values to a sql automatically. The email format is always the same for each email, eg,
First name :
Last name :
Phone number :
etc...
Currently the emails are being stored in a pop 3 account however i want a way to reduce having to key the information into the sql by hand.
Can anyone advise how i would go about doing this or could recommend some guides?
Thanks.
Steve
I would recommend using a class like this POP3 client at CodeProject to read the mail messages.
Once you have the message content, you should be able to fairly easily parse the string, since you know the exact format. There isn't enough information to recommend the best option for this - it depends on whether it's fixed format, delimited, separate lines, etc, but using regular expressions or even String.Split should make this fairly simple.
We use a purchased tool Email2Db tool to process incoming email. It is inexpensive and easy to configure. I wrote custom vb scripts for our needs but a simple insert into a db would not require any coding.
Related
So, I want to implement a function om my C# program, basically what I want to do is find a way to make the program identify the computer which its being accessed so if a not authorize computer try to access it the program will not open.
The way that I want to implement this is at the login screen the person that want to login will need to put their cellphone number and their password but if for some reason a person discover a functionary password and cellphone number and try to access the program with a computer that is not authorized to use the program the program will send a SMS to the functionary cellphone which they put and the person will need to put the aleatory code that will appear in the functionary cellphone, so basically I want to know how and if there is a way to do it, I am a noob with coding,but I appreciate any help.
(sorry for any grammar errors or bad English)
As far as I'm aware, C# does not have a built in way to send SMS. But fear not, there is an online API you can use that is used by a good deal of big businesses. It's called Twilio, and they have a C# library you can access. The only issue that one might have with it is that it does cost money to use their services.
Hope this helps!
Does it need to be an SMS? If not, you can use the Time-Based One-Time Password Algorithm to have one-time codes. There are several .NET libraries available that provide this functionality.
Depending on the cell provider, you can have your c# application send an email to a phone # and the recipient will see that message in their text conversations. I've done this with AT&T sending an email to phonenumber#mms.att.net. Of course you will have to deal with different providers and how/if they accommodate this feature.
I have an email address in a sql table in the following format:
clerk#weavers.org.uk
How can I convert it to the proper format?
I see it displays perfectly on a webpage but anywhere else it's like this. I am assuming it's codes for alphabets etc. (html) which get converted, but how do I update my table with the proper emails?
Thank you.
Take a look at the HttpServerUtility.HtmlDecode method, you should be able to write a loop to process all your data or write an extended stored procedure and call it from SQL.
If it's a small amount - you can use a tool like this: http://www.web2generators.com/html/entities
You can use the information found at http://www.lookuptables.com/ to write code to decode it yourself, or like Tony has suggested; use HttpServerUtility.HtmlDecode
I don't know of any good way to do this in with SQL - I'd write a small app to process the data.
If you're looking for a one-time fix for this one record: As you say it displays correctly on the screen, then cool: Display it on whatever screen that is, then copy and paste that value back into a database update, either a screen or a one-shot query.
If you're software is putting these escapes into the email address before saving to the database, I'd say: Don't. This is a bad idea, because then you can't search it or manipulate it. Store all values in "real" text. Do your HTML escaping when you are laying out a screen. Actually in ASP.NET I think most of the display functions do this automatically; some have flags to tell it to NOT HTML escape.
Addendum: I see Tony's answer assumes all your email addresses look like this. Is this correct, or is it just one? If it's all, then my suggestion for fixing one is impractical, you do indeed want to write a little program that loops through the db and fixes them all with HtmlDecode.
how can we check that a validated Email exist Or Not Without Sending test Email by c# codes?
we can check Validation of that email by many ways...
but what about existence?
is it possible to do that or not ?
thanks in advance
You should look at these websites. I've used a similar method to these three in the past when validating users emails for a federal website that required an authentic email address.
http://tools.email-checker.com/
http://verify-email.org/
http://www.technixupdate.com/check-whether-an-email-id-is-valid-or-not/
A mail server will usually quickly send back a response telling you if the email is valid or not, that is what you're going to be looking for.
As well, SO already has a few posts on this:
Checking if an email address exists
is one of them.
Update:
I love the existence tag...!
You could possibly use C# to run a cmd command - telnet. Then output the results to a text file and read them into to your C# app. This should help - http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email You will need to know the details for the mail server names though. You might be able to do this directly from C# but I have only done it through telnet.
I don't know if there's a good way to do what you're looking for, but a solution that might get you part of the way there is to ping the domain to at least make sure that exists.
Here's an MSDN link which explains how to ping from .NET:
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx
You can use a Regex Validation on the form before the user submits the data. It's an inbuilt tool in Microsoft Visual Studio where you can pretty much drag and drop :)
You should be able to find it in the validation section . Regular expression Validator
I'm looking for a really good library/component/framework for creating e-mail templates for my web application.
We send out a number of e-mails on a regular basis:
Activate Your Account
Welcome
Thanks for Your Order
Etc.
I'd like to give the non-technical administrators of my web app a way to:
See the current e-mail template (HTML, WYSIWYG)
Make some minor modifications to copy, colors, etc.
Preview, Test, Save, and "deploy" a new version of the e-mail template.
The tool needs to support "merge" fields. For an example, see MailChimp.com. They allow users to create e-mail templates and then specify any number of fields like this:
|FIELD1|
|FIELD2|
Then, when sending an e-mail, the developer passes-in the appropriate info for each field.
An example:
Hi *|FIRSTNAME|*,
Thanks for signing up. You rule!
Best regards,
MyWebSite.com
Does anyone know of a tool like this that can plug into my ASP.NET / C# web app? I assume someone out their wrote a library/component/something that I can license.
Thanks!
Try this one. It's free and open source:
http://mailsystem.codeplex.com/
It includes some classes specifically designed for mail merging
What's nice is that you can use its mail merging capabilities and still use system.net.mail for sending the email to avoid breaking your code.
Here is another option.
http://ntemplates.codeplex.com/
I want to integrate our bug tracker system and our Support system through emails.
The bug tracker can kick out an email on every change to bugs/features. I want to download those emails, parse them and create a formatted email that the Support system can understand (ie the subject could be "Issue #4128 fixed").
What is the simplest way to accomplish this using C++ or C#?
Martin, I'd say there's no "simplest" way to do this. The easy part is downloading the e-mail. (If that's what you need help with, say so and I'll post some C# code that does this.) How you parse the e-mail depends on the format of the message.
For instance, if the body of the message contains the data you want to provide to your support system, your approach will be different than if that data is included as an attachment to the message.
With more information, I'm sure we can be more helpful.