473,382 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Is there any object in .net 2.0 for mail?

Hi, I am looking to create an object of a mail message and pass to to my another function running on my SMTP server (so that we dont have to configure SMTP server on our each client). Is there any way or object out there in vb.net 2005 that let us create an object of a mail and pass it to another function, where i can parse all the fields?
Jun 19 '07 #1
10 1155
Plater
7,872 Expert 4TB
You are in luck, there is a whole article for sending mail in .NET.
http://www.thescripts.com/forum/thread648873.html
Jun 19 '07 #2
Frinavale
9,735 Expert Mod 8TB
Hi, I am looking to create an object of a mail message and pass to to my another function running on my SMTP server (so that we dont have to configure SMTP server on our each client). Is there any way or object out there in vb.net 2005 that let us create an object of a mail and pass it to another function, where i can parse all the fields?
I suggest creating a web service that will send the email for you...

Have your function in your windows application create the body of the email message, and collect the "to" and "from" information....then have your function send that information to your web service which will send the email for you (follow the article that Plater has suggest you read for instructions on how to send an email)

Cheers!

-Frinny
Jun 19 '07 #3
I suggest creating a web service that will send the email for you...

Have your function in your windows application create the body of the email message, and collect the "to" and "from" information....then have your function send that information to your web service which will send the email for you (follow the article that Plater has suggest you read for instructions on how to send an email)

Cheers!

-Frinny
Hey guys, Thanks very much for your reply.
Frinavale, That is exectly what i want. I want to sent all the mail information to my web service and and this web service will sent the emails out. Do you have any article that explains how to do this? Thanks very much.
Jun 19 '07 #4
Frinavale
9,735 Expert Mod 8TB
Hey guys, Thanks very much for your reply.
Frinavale, That is exectly what i want. I want to sent all the mail information to my web service and and this web service will sent the emails out. Do you have any article that explains how to do this? Thanks very much.
That sounds like an awesome article to write!
I'll see if I can whip one up...but in the mean time I'm sorry we don't really have anything here on theScripts in that regard.

What exactly are you stuck on?
How to create a web service?
How to use that web service?
How to send an email?

-Frinny
Jun 19 '07 #5
That sounds like an awesome article to write!
I'll see if I can whip one up...but in the mean time I'm sorry we don't really have anything here on theScripts in that regard.

What exactly are you stuck on?
How to create a web service?
How to use that web service?
How to send an email?

-Frinny
I want to know, How to create a web service and how to use it. Thanks very much.
Jun 19 '07 #6
Frinavale
9,735 Expert Mod 8TB
I want to know, How to create a web service and how to use it. Thanks very much.

Well if you're really patient and want to learn this properly I suggest you check out MSDN.

How Web Services actually work can get pretty complicated...they use Soap, which is based on XML to send information to and from your Web Service.

The Web Service itself is really just a bunch of functions hosted on the web that you can access from your desktop application or web application written in any language.

They are really powerful! Mainly because you can write a function in C# and host it as a Web Service..then you can use it in a Java application or VB application... or even Cobol.

.NET makes it pretty easy though.

I'd suggest looking up Web Services with Google to get started....there are plenty of tutorials out there to get you started.

-Frinny
Jun 19 '07 #7
Hey Frinny Thanks for your suggestion, I have everything set up and it works. The only thing i am stuck on right now is, How can I send the attachments (more then one documents) to the web service?

If I try to pass MailAttachment as a peremeter then it gives me this error:
System.Web.Mail.MailAttachment cannot be serialized because it does not have a default public constructor.

Any suggestions?

Thanks,
Jerry
Jun 21 '07 #8
Frinavale
9,735 Expert Mod 8TB
Hey Frinny Thanks for your suggestion, I have everything set up and it works. The only thing i am stuck on right now is, How can I send the attachments (more then one documents) to the web service?

If I try to pass MailAttachment as a peremeter then it gives me this error:
System.Web.Mail.MailAttachment cannot be serialized because it does not have a default public constructor.

Any suggestions?

Thanks,
Jerry
What are you trying to send as an attachment?
Remember before how I said that Web Services use Soap to send messages.
This limits the object types that you are able to send to your service.

Instead of trying to send System.Web.MailAttachment, you will have to take your attachment, serialize it into a format that can be sent using Soap (likely text or something) before you can try to send it to the Web Service....then in your Web Service, you will have to recreate the Attachment and go from there.

Am I making any sense?

-Frinny
Jun 21 '07 #9
What are you trying to send as an attachment?
Remember before how I said that Web Services use Soap to send messages.
This limits the object types that you are able to send to your service.

Instead of trying to send System.Web.MailAttachment, you will have to take your attachment, serialize it into a format that can be sent using Soap (likely text or something) before you can try to send it to the Web Service....then in your Web Service, you will have to recreate the Attachment and go from there.

Am I making any sense?

-Frinny
Yes, Thats exactly what I am trying to do, but havent got any sucess yet. Can you point me to any link or documentation that explains how to convert the files into a format that can be sent to the Web Service. And after its received by the web service, how can i reconvert into the original file.
Thanks for your help!

Jerry
Jun 21 '07 #10
Frinavale
9,735 Expert Mod 8TB
You're going to want to look up Serialization.

This is a great article on using serialization in .NET (scroll down past the advertisements...)
This article also looks pretty good as well...especially part 5.

I'm really happy that this stuff is working out so well for you!

-Frinny
Jun 21 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
1
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
3
by: pmud | last post by:
Hi, I have ab ASP.Net Application in which I need to send e-mail on button click. Even though my C# code for that is correct.I am getting the following error:: I think the following error can be...
5
by: Ram | last post by:
Hi Friends I want to develope a custom control in .net which can be used with any project. I am writing a function in that class which I want to take any object as parameter. For that I have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.