Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic .NET (http://www.programmingforums.org/forum19.html)
-   -   Mailing Program (http://www.programmingforums.org/showthread.php?t=13494)

NightShade01 Jul 7th, 2007 9:17 PM

Mailing Program
 
Hey everyone I just had a quick question. I just finished writing a very very simple mail client (litterally all it does is send msg's). I was wondering, sometimes when I send mail it goes really quick and appears almost instantly on the receiving server however sometimes it sends quickly and takes longer (about 45 secs) to appear on the server. I'm not complaining about the time it's not important just curious as to why it might do that. Any thoughts?

-Test it with different sized email which doesn't seem to have any impact on it.

lectricpharaoh Jul 8th, 2007 2:53 AM

Many things can account for this, including network conditions (takes the mail longer to arrive), server load (takes the server longer to process it), mail content (some servers may apply filters and/or virus scanning of attachments, either of which may slow processing), and any number of other things.

Infinite Recursion Jul 8th, 2007 11:18 AM

I agree with lectricpharaoh. There are a lot of moving parts involved in this process and any one of them could cause a delay.

mattireland Jul 8th, 2007 12:42 PM

Yeh, it's all pretty much been said. Please can you upload the source? I'd be really, really interested to see it as I've wanted to include mail in one of my programs! I'd give you credit for the small bit that I'd use it for and if it sweeps the nation like I'm hoping it would - we'd both be famous!

john Wesley Jul 8th, 2007 1:16 PM

mattireland, why dont you just read the documentation of the System.Net.Mail namespace and get the satisfaction of doing it yourself?

mattireland Jul 8th, 2007 1:20 PM

Right, now I know the namespace I will. That's all I really wanted. Thanks!

mattireland Jul 8th, 2007 2:10 PM

Hey guys! Sorry to invade this thread but why isn't this working?

:

    Dim sendto = "matt@mattireland.co.uk"

    Private Sub Send1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Send1.Click
        'create the mail message
        Dim mail As New Net.Mail.MailMessage()

        'set the addresses
        mail.From = New Net.Mail.MailAddress("program@program.com")
        mail.To.Add("matt@mattireland.co.uk")

        'set the content
        mail.Subject = "testing"
        mail.Body = "testing program"

        'send the message
        Dim smtp As New Net.Mail.SmtpClient("127.0.0.1")
        smtp.Send(mail)
        MsgBox("The message has been sent to: " & sendto)



    End Sub


I get an unhandled exception error and it says that the sending has failed. Thanks!

PhilBon Jul 8th, 2007 5:14 PM

is your mail server on? As well as does it need authentication? Are you sure you have everything you need?

john Wesley Jul 8th, 2007 5:45 PM

Yeah as PhilBon has just said, you would need to send mail through a mail server - if you dont have your own set-up you would generally send them via your mail provider's server.

Also, alot of servers wont just receive mail from anyone and again as PhilBon mentioned, you generally need to use an Ssl connection.

mattireland Jul 8th, 2007 6:19 PM

How do I set up the mail server? Sorry I'm a bit of a noob at this mail stuff still.

Thanks!


All times are GMT -5. The time now is 2:48 AM.

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