Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 8th, 2007, 6:03 PM   #11
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
I just have to be an ass and say "A bit" I think that's an under statement. Google SMTP server or go to download.com and search for SMTP server. Or if you have windows xp pro, or server, install IIS, and there is a default smtp server in there. Once you have an SMTP server, you will want to then learn how to configure it
PhilBon is offline   Reply With Quote
Old Jul 8th, 2007, 7:27 PM   #12
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 3 NightShade01 is on a distinguished road
Wow alot of posts to original quesiton thanks everyone! I figured as much as was posted just wanted a second opinion. As for mattireland asking here is what I have so far (keep in mind that I threw this together in under 10 mins so the code works but isn't secure in anyway:

Dim obj As System.Net.Mail.SmtpClient
    Dim smtpServer As String = "mail.optonline.net"
    Dim Mm As System.Net.Mail.MailMessage
    Dim recip As System.Net.Mail.MailAddress
    Dim sender As System.Net.Mail.MailAddress


Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        obj = New System.Net.Mail.SmtpClient
        obj.Host() = smtpServer
        obj.Port() = 25
        obj.EnableSsl = False

        If txtTo.Text = "" Then
            MsgBox("You must enter a recipient", MsgBoxStyle.Exclamation, "Error")
        End If

        If txtFrom.Text = "" Then
            MsgBox("You must enter a sender", MsgBoxStyle.Exclamation, "Error")
        End If

        If txtSubject.Text = "" Then
            MsgBox("You must enter a subject", MsgBoxStyle.Exclamation, "Error")
        End If

        recip = New System.Net.Mail.MailAddress(txtTo.Text)
        sender = New System.Net.Mail.MailAddress(txtFrom.Text)
        Mm = New System.Net.Mail.MailMessage(sender, recip)
        Mm.Subject() = txtSubject.Text
        Mm.Body = txtBody.Text

        Try
            obj.Send(Mm)
            MsgBox("Mail successful!", MsgBoxStyle.Exclamation, "Success")
        Catch ex As Exception
            MsgBox("The mail service could not be reached", MsgBoxStyle.Critical, "Bad Connection")
        End Try

    End Sub

Again not the best code but still it works. Also you don't have anything wrong with your code except what everyone else said that you aren't running a mail server and you should smtp if you want to work with mail (highly important).

Anyone feel free to comment/critique my code...
NightShade01 is offline   Reply With Quote
Old Jul 8th, 2007, 7:55 PM   #13
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 3 NightShade01 is on a distinguished road
On a similar note I've done some extensive searching for ways to implement a receive feature for e-mail but none of them seem to be clean cut. Anyone have any suggestions on which way to go with receiving mail?
NightShade01 is offline   Reply With Quote
Old Jul 8th, 2007, 10:52 PM   #14
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
looking at that code, it appears to be much better in the way that you are using the objects.
PhilBon is offline   Reply With Quote
Old Jul 9th, 2007, 8:09 AM   #15
john Wesley
Hobbyist Programmer
 
john Wesley's Avatar
 
Join Date: May 2006
Location: United Kingdom
Posts: 119
Rep Power: 3 john Wesley is on a distinguished road
Send a message via MSN to john Wesley Send a message via Yahoo to john Wesley
Could you elaborate on why you think the code would appear to be 'better' because of 'the way' he is using objects? - I cant understand why you would think so.
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles..
john Wesley is offline   Reply With Quote
Old Jul 10th, 2007, 3:11 PM   #16
mattireland
Hobbyist Programmer
 
mattireland's Avatar
 
Join Date: Jul 2007
Location: Wales, United Kingdom
Posts: 201
Rep Power: 2 mattireland is on a distinguished road
Send a message via MSN to mattireland Send a message via Skype™ to mattireland
Thanks for all the responses guys - especially NightShade01 - definitely thanks! I'll give it a go in a few mins. Thanks again!
__________________
Matt Ireland
http://www.mattireland.org
matt@mattireland.co.uk
mattireland is offline   Reply With Quote
Old Jul 14th, 2007, 3:51 PM   #17
mattireland
Hobbyist Programmer
 
mattireland's Avatar
 
Join Date: Jul 2007
Location: Wales, United Kingdom
Posts: 201
Rep Power: 2 mattireland is on a distinguished road
Send a message via MSN to mattireland Send a message via Skype™ to mattireland
Thanks again for posting your code. I've sort of mucked around with it a bit but it's still not working. Can anyone lend me a hand?:

    Dim txtTo = "matt@mattireland.co.uk"
    Dim txtFrom = "matt@mattireland.co.uk"
    Dim txtSubject = "Hello"
    Dim txtBody = "Test"


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim obj As System.Net.Mail.SmtpClient
        Dim smtpServer As String = "mail.optonline.net"
        Dim recip As System.Net.Mail.MailAddress
        Dim sender1 As System.Net.Mail.MailAddress

        obj = New System.Net.Mail.SmtpClient
        obj.Host() = smtpServer
        obj.Port() = 25
        obj.EnableSsl = False

        If txtTo = "" Then
            MsgBox("You must enter a recipient", MsgBoxStyle.Exclamation, "Error")
        End If

        If txtFrom = "" Then
            MsgBox("You must enter a sender", MsgBoxStyle.Exclamation, "Error")
        End If

        If txtSubject = "" Then
            MsgBox("You must enter a subject", MsgBoxStyle.Exclamation, "Error")
        End If

        recip = New System.Net.Mail.MailAddress(txtTo)
        sender1 = New System.Net.Mail.MailAddress(txtFrom)
        Dim Mm5 As New System.Net.Mail.MailMessage(sender1, recip)
        Mm5.Subject() = txtSubject
        Mm5.Body = txtBody

        Try
            obj.Send(Mm5)
            MsgBox("Mail successful!", MsgBoxStyle.Exclamation, "Success")
        Catch ex As Exception
            MsgBox("The mail service could not be reached", MsgBoxStyle.Critical, "Bad Connection")
        End Try

    End Sub

Just back onto the SMTP server: I do I configure the built in one in xp pro??? Thanks!
__________________
Matt Ireland
http://www.mattireland.org
matt@mattireland.co.uk
mattireland is offline   Reply With Quote
Old Aug 9th, 2007, 2:26 AM   #18
Bharathi
Programmer
 
Join Date: Apr 2005
Posts: 32
Rep Power: 0 Bharathi is on a distinguished road
Sending emails from ASP.Net page

Hi,

string sURL, sFullURL, sBody, URLText;

sURL = "http://www.jobssite.com/sitejob/ractken.aspx";
sFullURL = sURL + "?Code=" + sCode;
URLText = "Jobsken Site";

String displayResult = "Go to <A HREF=" + sFullURL + " >" + URLText + "</A>";
Response.Write(displayResult);

String strHTMLBody;

strHTMLBody = "<html><head><title>Confirm your registration.</title></head><body>Congratulations ! You have successfully completed registration.<br /><br />Now you need to confirm your registration.<br /><br />To confirm your registration, click on the link : <A HREF=" + sFullURL + " >" + URLText + "</A><br /><br />Regards,<br />From the team at Jobs.</body></html> ";


MailMessage oMessage = new MailMessage();
oMessage.Subject = "Confirm your registration. Jobs";
oMessage.Body = strHTMLBody;
oMessage.IsBodyHtml = true;
oMessage.From = new MailAddress("job@jobs.com");
oMessage.To.Add(new MailAddress(txtEmail.Text));
oMessage.Priority = MailPriority.High;

SmtpClient client = new SmtpClient("smtp.XXXXXX.com");

client.UseDefaultCredentials = true;
client.Send(oMessage);


Database programming using Visual Basic 2005
Bharathi is offline   Reply With Quote
Old Aug 9th, 2007, 3:24 AM   #19
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,009
Rep Power: 5 lectricpharaoh will become famous soon enough
@Bharathi: You've been a member of the forums for over two years, but you still haven't figured out [code] tags?
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB 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
Language display in program Prm753 C++ 3 May 30th, 2006 5:45 PM
Help me program this with Watcom! DBZ Other Programming Languages 3 Feb 26th, 2006 9:41 PM
Creating a program to test a program sixstringartist C 8 Jan 21st, 2006 1:15 PM
move program console window back badbasser98 C++ 21 Oct 18th, 2005 2:02 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 4:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:08 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC