GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-Dec-2007, 12:01
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 761
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Email Automation using MailMessage


Hello All,

I'm trying to use the MailMessage object with a SmptClient object to send an email from within a window application. Here is what the code looks like:

C-SHARP / C# Code:
        private void SendButton_Click(object sender, EventArgs e)
        {
            MailMessage message = new MailMessage("abc@gmail.com", "abc@gmail.com", "Test", "Hello, the message worked.");

            //Send the message.
            SmtpClient client = new SmtpClient("localhost");

            try { client.Send(message); }
            catch ( Exception ex) { MessageBox.Show(ex.Message); }

        }

This will encounter an exception with message "Failure Sending Mail". I believe this is because the client is not set up for sending mail. Does anyone know if it has to be set up as a mail server?

Also, if that is the case, could I use an existing mail server (like "http://www.google.com") as the server name in my client?

The goal is to be able to load this program on any machine connected to the internet and have it send an email to the administrator automatically.

Any help is appreciated.

Thanks,
fakepoo
  #2  
Old 29-Feb-2008, 08:14
Computeretard66 Computeretard66 is offline
New Member
 
Join Date: Feb 2008
Location: NYC
Posts: 4
Computeretard66 is on a distinguished road

Re: Email Automation using MailMessage


maybe these threads can help u:

forums.asp.net

www.thescripts.com
  #3  
Old 29-Feb-2008, 08:15
Computeretard66 Computeretard66 is offline
New Member
 
Join Date: Feb 2008
Location: NYC
Posts: 4
Computeretard66 is on a distinguished road

Re: Email Automation using MailMessage


crap, the exact threads werent posted. i copied and pasted it, but it wont let it. sorry.
  #4  
Old 29-Feb-2008, 08:41
fakepoo fakepoo is offline
Regular Member
 
Join Date: Oct 2007
Posts: 761
fakepoo is a jewel in the roughfakepoo is a jewel in the roughfakepoo is a jewel in the rough

Re: Email Automation using MailMessage


In order to link to a separate page, use the "Insert Link" button above on a highlighted word. (It's the globe one). I would really appreciate the links.

Thanks.
  #5  
Old 29-Feb-2008, 08:51
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 859
admin will become famous soon enough

Re: Email Automation using MailMessage


Computeretard66 cannot post links yet. He needs to get to Level 2 first.

Quote:
Originally Posted by Computeretard66
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #6  
Old 26-Apr-2008, 05:25
Peter_APIIT Peter_APIIT is offline
Regular Member
 
Join Date: May 2007
Location: Malaysia
Posts: 545
Peter_APIIT can only hope to improve

Re: Email Automation using MailMessage


As far as i know, one cannot set up email address from public email server with Linux Evolution. Perhaps the protocols is different.
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Daily Opt-In Email Leads - "Download 2,000 Email List Every Hour" geza1969 Member Announcements, Advertisements & Offers 1 10-Dec-2007 21:40
Bulk Email hosting *** .com Bullet proof hosting additional2 Web Hosting Advertisements & Offers 1 20-May-2007 13:55
bulk Email Marketing Bullet proof hosting additional2 Web Hosting Advertisements & Offers 0 08-Jul-2006 12:57

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 10:02.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.