View Poll Results: Would you use this SMTP server class?
- Voters
- 41. You may not vote on this poll
-
I am very interested and look forward to seeing the end result
-
I would probably give it a go when it is complete
-
I am not really interested myself but it sounds like a good idea
-
I think it would be useless
-
Feb 11th, 2010, 05:25 PM
#81
Re: Would you use my .NET SMTP server class?
OK see the following link for a debug version that will output plenty of information to the Immediate Window (just using Debug.WriteLine) : http://www.cjwdev.co.uk/DeveloperCom...EBUG-BUILD.zip
When I use the code I posted a couple of posts back and run it with these debug versions of the DLLs, I see the following in my Immediate Window:
Code:
SendEmail method called, performing property/argument validation...
Property/argument validation complete
Starting loop through recipients...
Starting send for [email protected] ...
Checking recipient domain name is valid...
Recipient domain validation complete
Creating DnsClient instance (DNS server 192.168.0.254) ...
DnsClient instance created
Performing MX lookup for gmail.com ...
Sent MX record lookup for gmail.com
Sent A record lookup for alt3.gmail-smtp-in.l.google.com
Sent A record lookup for alt2.gmail-smtp-in.l.google.com
Sent A record lookup for alt1.gmail-smtp-in.l.google.com
Sent A record lookup for alt4.gmail-smtp-in.l.google.com
Sent A record lookup for gmail-smtp-in.l.google.com
MX lookup complete, 5 MX records found
Starting loop through MX records...
Starting loop through email server IP addresses in this record...
Initiating connection with remote SMTP server 209.85.220.29 on worker thread...
Checking to see if initial connection was successful...
Initial connection was successful, set wait signal and wait for this thread to be unblocked by the worker thread...
No previous SMTP command sent, sending EHLO command...
Last SMTP command sent: Ehlo
Last SMTP command sent: MailFrom
Last SMTP command sent: RcptTo
Last SMTP command sent: DataCommand
Last SMTP command sent: Data
No errors reported from server - classing message as being submitted successfully
Ending SMTP session for the following reason: MessageSubmittedSuccessfully
Unblocking original thread...
Worker thread unblocked original thread, checking session result
Loop through mail server IP addresses complete
Loop through MX records complete
Loop through recipients complete, returning result list to caller of SendEmail method
Can you try running it and post exactly what you get in the Immediate Window? Thanks
-
Feb 11th, 2010, 06:26 PM
#82
Re: Would you use my .NET SMTP server class?
I suggest to mask e-mail addresses (unless you want another ton of spam)
-
Feb 11th, 2010, 07:02 PM
#83
Re: Would you use my .NET SMTP server class?
I get no spam right now, so I feel very left out. Nothing in my Junk Mail/Spam folder either. I just don't get any. That's something I don't know anything about. I wish I would get some for a change.
-
Feb 12th, 2010, 12:45 AM
#84
Re: Would you use my .NET SMTP server class?
I ran the debug dll's and...nothing showed in the Immediate Window when I used them which makes no sense. I originally had the code on a Background Thread, so I moved it back and still got nothing.
If it helps, here's the code:
vb.net Code:
Public Class Form1 Dim Smtp As New Cjwdev.Mail.SmtpSender() Dim WithEvents SendMail As New System.ComponentModel.BackgroundWorker Dim msg As String = String.Empty Dim FromEmail As String = String.Empty Dim Subject As String = String.Empty Dim ToEmail As String = String.Empty Dim thread As System.Threading.Thread Dim WithEvents timer As New System.Timers.Timer With {.Interval = 100, .AutoReset = True} Private Sub SendOut() Dim emailList As New List(Of String) emailList.Add(ToEmail) Try Smtp.SendEmail(FromEmail, emailList, Subject, msg) Catch ex As Exception MessageBox.Show(ex.ToString) End Try End Sub Private Sub SendBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendBtn.Click If (FromEmailBox.Text <> String.Empty) AndAlso (ToFieldBox.Text <> String.Empty) AndAlso (SubjectBox.Text <> String.Empty) AndAlso (SendMessageBox.Text <> String.Empty) Then msg = SendMessageBox.Text FromEmail = FromEmailBox.Text Subject = SubjectBox.Text ToEmail = ToFieldBox.Text AnimationBar.Style = ProgressBarStyle.Marquee SendBtn.Enabled = False 'thread = New Threading.Thread(AddressOf SendOut) 'thread.IsBackground = True 'thread.Start() Call SendOut() 'timer.Enabled = True End If End Sub Private Delegate Sub d_EnableControls() Private Sub enableControls() SendBtn.Enabled = True AnimationBar.Style = ProgressBarStyle.Blocks timer.Enabled = False End Sub Private Sub timer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles timer.Elapsed If Not thread.IsAlive Then Me.Invoke(New d_EnableControls(AddressOf enableControls)) End If End Sub End Class
You can see where I commented out a few things here and there to move it back to the UI thread.
-
Feb 12th, 2010, 03:18 PM
#85
Re: Would you use my .NET SMTP server class?
Hmm that is odd... I'll rebuild the debug DLLs and have them just write to a text file rather than using Debug.WriteLine. I'll edit this post when I've uploaded the new ones.
EDIT: OK try downloading the files again (using the same link as I posted in the last post) and running it again. Its just set to write to a text file named DebugLog.txt in the directory that the program is running from, so if you are testing this from within VS then it will be in the Bin\Debug folder of your solution. Let me know how it goes 
Also, Formlesstree - are you saying that when you tried to send an email it did the same as what minitech is seeing? Or were you just trying out the debug files and commenting on the debug logging not working but the email still actually sent ok?
Last edited by chris128; Feb 12th, 2010 at 03:29 PM.
-
Feb 12th, 2010, 06:27 PM
#86
Re: Would you use my .NET SMTP server class?
Did the same as Minitech, nothing happened.
EDIT: Downloaded the update..got this:
Code:
2/12/2010 5:29:09 PM SendEmail method called, performing property/argument validation...
2/12/2010 5:29:09 PM Property/argument validation complete
2/12/2010 5:29:09 PM Starting loop through recipients...
2/12/2010 5:29:09 PM Starting send for ***@yahoo.com ...
2/12/2010 5:29:09 PM Checking recipient domain name is valid...
2/12/2010 5:29:09 PM Recipient domain validation complete
2/12/2010 5:29:09 PM Creating DnsClient instance (DNS server 10.0.0.1) ...
2/12/2010 5:29:09 PM DnsClient instance created
2/12/2010 5:29:09 PM Performing MX lookup for yahoo.com ...
2/12/2010 5:29:09 PM MX lookup complete, 8 MX records found
2/12/2010 5:29:09 PM Starting loop through MX records...
2/12/2010 5:29:09 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:29:09 PM Initiating connection with remote SMTP server 67.195.168.31 on worker thread...
2/12/2010 5:29:30 PM Checking to see if initial connection was successful...
2/12/2010 5:29:30 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:29:30 PM Loop through mail server IP addresses complete
2/12/2010 5:29:30 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:29:30 PM Initiating connection with remote SMTP server 74.6.136.65 on worker thread...
2/12/2010 5:29:51 PM Checking to see if initial connection was successful...
2/12/2010 5:29:51 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:29:51 PM Loop through mail server IP addresses complete
2/12/2010 5:29:51 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:29:51 PM Initiating connection with remote SMTP server 206.190.54.127 on worker thread...
2/12/2010 5:30:12 PM Checking to see if initial connection was successful...
2/12/2010 5:30:12 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:30:12 PM Loop through mail server IP addresses complete
2/12/2010 5:30:12 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:30:12 PM Initiating connection with remote SMTP server 209.191.88.254 on worker thread...
2/12/2010 5:30:33 PM Checking to see if initial connection was successful...
2/12/2010 5:30:33 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:30:33 PM Loop through mail server IP addresses complete
2/12/2010 5:30:33 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:30:33 PM Initiating connection with remote SMTP server 67.195.168.230 on worker thread...
2/12/2010 5:30:54 PM Checking to see if initial connection was successful...
2/12/2010 5:30:54 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:30:54 PM Loop through mail server IP addresses complete
2/12/2010 5:30:54 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:30:54 PM Initiating connection with remote SMTP server 98.137.54.237 on worker thread...
2/12/2010 5:31:15 PM Checking to see if initial connection was successful...
2/12/2010 5:31:15 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:31:15 PM Loop through mail server IP addresses complete
2/12/2010 5:31:15 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:31:15 PM Initiating connection with remote SMTP server 98.137.54.238 on worker thread...
2/12/2010 5:31:36 PM Checking to see if initial connection was successful...
2/12/2010 5:31:36 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:31:36 PM Loop through mail server IP addresses complete
2/12/2010 5:31:36 PM Starting loop through email server IP addresses in this record...
2/12/2010 5:31:36 PM Initiating connection with remote SMTP server 66.94.236.34 on worker thread...
2/12/2010 5:31:57 PM Checking to see if initial connection was successful...
2/12/2010 5:31:57 PM Initial connection failed, moving on to next mail server IP (if there is one)
2/12/2010 5:31:57 PM Loop through mail server IP addresses complete
2/12/2010 5:31:57 PM Loop through MX records complete
2/12/2010 5:31:57 PM Loop through recipients complete, returning result list to caller of SendEmail method
Obviously I edited out the email address, but that's the log. Looks like Yahoo rejected me.
Last edited by formlesstree4; Feb 12th, 2010 at 06:35 PM.
-
Feb 14th, 2010, 10:54 AM
#87
Re: Would you use my .NET SMTP server class?
Ok, here we are. Infinite loop, there's a connection faliure to the only IP address so it loops back to it.
Code:
14/02/2010 7:52:20 AM SendEmail method called, performing property/argument validation...
14/02/2010 7:52:20 AM Property/argument validation complete
14/02/2010 7:52:20 AM Starting loop through recipients...
14/02/2010 7:52:20 AM Starting send for [email protected] ...
14/02/2010 7:52:20 AM Checking recipient domain name is valid...
14/02/2010 7:52:20 AM Recipient domain validation complete
14/02/2010 7:52:20 AM Creating DnsClient instance (DNS server 64.59.160.13) ...
14/02/2010 7:52:20 AM DnsClient instance created
14/02/2010 7:52:20 AM Performing MX lookup for gmail.com ...
14/02/2010 7:52:20 AM MX lookup complete, 5 MX records found
14/02/2010 7:52:20 AM Starting loop through MX records...
14/02/2010 7:52:20 AM Starting loop through email server IP addresses in this record...
14/02/2010 7:52:20 AM Initiating connection with remote SMTP server 209.85.222.31 on worker thread...
14/02/2010 7:52:41 AM Checking to see if initial connection was successful...
14/02/2010 7:52:41 AM Initial connection failed, moving on to next mail server IP (if there is one)
14/02/2010 7:52:41 AM Loop through mail server IP addresses complete
14/02/2010 7:52:41 AM Starting loop through email server IP addresses in this record...
14/02/2010 7:52:41 AM Initiating connection with remote SMTP server 209.85.211.45 on worker thread...
14/02/2010 7:53:02 AM Checking to see if initial connection was successful...
14/02/2010 7:53:02 AM Initial connection failed, moving on to next mail server IP (if there is one)
14/02/2010 7:53:02 AM Loop through mail server IP addresses complete
14/02/2010 7:53:02 AM Starting loop through email server IP addresses in this record...
14/02/2010 7:53:02 AM Initiating connection with remote SMTP server 209.85.221.31 on worker thread...
-
Feb 17th, 2010, 04:55 AM
#88
Re: Would you use my .NET SMTP server class?
Thats not an infinite loop - the first IP is 209.85.222.31 and the last IP (the one it gets stuck on) is 209.85.221.31
It looks like something is blocking your connection to any servers on port 25 - although this should not cause my code to hang, it should just fail to connect to each of them and then return... let me have another look at the code and i'll see if I can see why it would just stop there..
-
Feb 17th, 2010, 04:58 AM
#89
Re: Would you use my .NET SMTP server class?
 Originally Posted by formlesstree4
Obviously I edited out the email address, but that's the log. Looks like Yahoo rejected me.
That looks more like the connection is being blocked not Yahoo rejecting you because of your IP address - if the SMTP server rejects you then it usually at least allows you to connect and then gives you an error in the SMTP session stating why you have been rejected. So it looks like either a firewall on your PC is blocking outbound connections on port 25 or your router or ISP is blocking it.
-
Feb 17th, 2010, 05:58 PM
#90
Re: Would you use my .NET SMTP server class?
I can mess with my router to see if opening port 25 does any difference.
-
Feb 17th, 2010, 06:05 PM
#91
Re: Would you use my .NET SMTP server class?
OK but usually routers are setup to allow all ports outbound, its just inbound that they usually block, so you shouldnt have to do anything... I guess its possible yours is blocking it outbound as well though. More likely to be a firewall or virus scanner on your PC though I would have thought (I know some versions of mcafee anti virus block port 25 to stop viruses sending mass spam mails from your PC).
Just do a quick test using telnet and see if you can telnet through on port 25 to any SMTP server that you KNOW accepts connections on port 25 and see what happens... e.g telnet smtp.live.com 25
-
Feb 17th, 2010, 06:11 PM
#92
Re: Would you use my .NET SMTP server class?
The connect failed.....what on earth does that mean? Is my ISP blocking me from doing it?
-
Feb 17th, 2010, 06:14 PM
#93
Re: Would you use my .NET SMTP server class?
 Originally Posted by formlesstree4
The connect failed.....what on earth does that mean? Is my ISP blocking me from doing it?
Its possible, or like I said a firewall/av on your PC or possibly your router
-
Feb 17th, 2010, 06:18 PM
#94
Re: Would you use my .NET SMTP server class?
PC has no firewall on, but let me try my router.
Just tried it...gonna see if my ISP blocks any ports.
-
Feb 18th, 2010, 03:34 AM
#95
Re: Would you use my .NET SMTP server class?
Hey,
Who is your ISP? It might be worth asking the question to them directly.
Gary
-
Feb 18th, 2010, 01:14 PM
#96
Re: Would you use my .NET SMTP server class?
I host my own mail server at home. I have AT&T DSL and I had to explicitly ask for port 25 to be opened. It took a ten minute phone call when I started using them and it has been working fine ever since.
-
Feb 18th, 2010, 05:11 PM
#97
Re: Would you use my .NET SMTP server class?
So you gotta call them to get it open? I got the same ISP you do Negative.
-
Feb 19th, 2010, 03:32 AM
#98
Re: Would you use my .NET SMTP server class?
Yeah, you will have to give them a call.
Gary
-
Feb 19th, 2010, 12:01 PM
#99
Re: Would you use my .NET SMTP server class?
huh, our ISPs here in the UK must not be as bothered about stopping spam as I've never had to ask for any ports to be opened with any of my ISPs..
-
Feb 19th, 2010, 12:04 PM
#100
Fanatic Member
Re: Would you use my .NET SMTP server class?
maybe that's why most of the spamming bot people are found overseas?
Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7
SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
[Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]
[.NET and MySQL Quick Guide]
-
Apr 26th, 2010, 08:17 PM
#101
Fanatic Member
Re: Would you use my .NET SMTP server class?
Wow, ths sounds really cool. I can't wait to see the finished product.
-
Apr 27th, 2010, 01:08 AM
#102
Re: Would you use my .NET SMTP server class?
Hey,
This most recent post has reminded me about this thread...
How's things going Chris?
Gary
-
Apr 27th, 2010, 02:43 AM
#103
Re: Would you use my .NET SMTP server class?
I havent done much with it recently to be honest as I've just had so much other stuff going on and it was taking up a lot of time. I did get it to successfully send some emails but I think some people on here encountered a few issues that I just never got chance to fully investigate. Might pick it back up soon but if anyone is really interested in the source code I guess I could make that available.
-
Apr 27th, 2010, 03:29 AM
#104
Re: Would you use my .NET SMTP server class?
I remember when you post somewhere long time ago that you started to work on that smtp server and that you'll probably fail doing so well, you prove yourself wrong, just wanted to say that this is really impressive
gj.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Apr 28th, 2010, 04:24 AM
#105
Re: Would you use my .NET SMTP server class?
 Originally Posted by motil
I remember when you post somewhere long time ago that you started to work on that smtp server and that you'll probably fail doing so  well, you prove yourself wrong, just wanted to say that this is really impressive
gj.
Thanks yeah I looked back over the code I've got so far yesterday and I'm quite happy that I've got as far as I have with it, as it seemed such a daunting task once I had started it and realised how much work was involved. I'll definitely have to try and spend some more time on it soon..
-
Jul 4th, 2010, 04:52 PM
#106
Fanatic Member
Re: Would you use my .NET SMTP server class?
How do you make a reference to your DLL?
Sorry for the noobish question :/
EDIT: doesn't matter, done it
Last edited by Emcrank; Jul 4th, 2010 at 05:01 PM.
-
Jul 4th, 2010, 04:56 PM
#107
Re: Would you use my .NET SMTP server class?
Just go to the Project menu and then go to Add Reference, then click the Browse tab and browse to the DLL
-
Jul 5th, 2010, 09:26 AM
#108
Re: Would you use my .NET SMTP server class?
 Originally Posted by Emcrank
How do you make a reference to your DLL?
Sorry for the noobish question :/
EDIT: doesn't matter, done it 
Don't worry about asking "noobish" questions. Everyone has to start somewhere, and no one on this forum should "flame" you for doing so.
Gary
-
Jul 5th, 2010, 10:00 AM
#109
Re: Would you use my .NET SMTP server class?
 Originally Posted by Emcrank
EDIT: doesn't matter, done it 
Cool did you try using the class and if so did it all work or did you have any problems?
-
Jul 5th, 2010, 10:57 AM
#110
Fanatic Member
Re: Would you use my .NET SMTP server class?
How do you acctually send an email. What email adress do you use?
I used the code you put at start
-
Jul 5th, 2010, 11:54 AM
#111
Re: Would you use my .NET SMTP server class?
How could I possibly tell you what email address to use? You use whatever email address you want to send to and whatever email address you want it to come from. As you will notice from one of my blog posts and some earlier posts in this thread though, you may have problems sending to hotmail/gmail/yahoo addresses if you are a home broadband user (rather than a business) due to restrictions that these email providers place on their servers to help stop spam.
-
Jul 5th, 2010, 01:16 PM
#112
Fanatic Member
Re: Would you use my .NET SMTP server class?
Noooo i meant, does the 'Sender' have to be one of my email addresses? or can i type anything in?
Also i was trying to send it to a gmail and hotmail so maybe thats why it wasn't reaching it in my inbox.
-
Jul 5th, 2010, 02:14 PM
#113
Re: Would you use my .NET SMTP server class?
Yeah you can specify anything you want as the sender address, though some spam filters do check to see if the IP address that you have matches the IP address that is registered as the mail handler/server for the email domain you are sending from.
As for sending to hotmail and gmail, unfortunately there is nothing I can do to fix that as its out of my control see here for a proper explanation of the problem if you are interested: http://cjwdev.wordpress.com/2010/01/...ress-report-4/
-
Jul 5th, 2010, 02:23 PM
#114
Re: Would you use my .NET SMTP server class?
As general point, spam email, and email spoofing, are big problems around the world, and not something that you should take part in!!! You should really only send email from domains/email address that you are in charge of, or own.
Gary
-
Jul 5th, 2010, 02:24 PM
#115
Fanatic Member
Re: Would you use my .NET SMTP server class?
Post #113: oh i guess its not much use then . O well.
Post #114: I wasn't sending it to anyone else. I was sending an email to myself when my program got opened
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|