Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail)
Winsock (sending e-mail) Winsock (sending e-mail)
Winsock (sending e-mail)
Go Back  Xtreme Visual Basic Talk > > > Winsock (sending e-mail)


Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2003, 09:40 AM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Default Winsock (sending e-mail)


I want my program to send me an e-mail but I can't get it to connect. I got this error: "Connection was forcefully rejected." The problem seems to be in this part of the program:

Winsock.RemoteHost = "mail.hotmail.com"
Winsock.RemotePort = 250

I just started using winsock a day ago, so I don't know much about it. I got my code from a tutorial at www.winsockvb.com.
Reply With Quote
  #2  
Old 03-25-2003, 10:04 AM
Squidge Squidge is offline
Restricted
 
Join Date: Mar 2003
Location: Manchester! England!
Posts: 872
Default

ok firstly, i may be wrong but i dont think you can send e-mail in that way. and i would advise you use the outlook controls, i'm sure there is an example on www.winsockvb.com :-) hope it helped
Reply With Quote
  #3  
Old 03-25-2003, 10:26 AM
Optikal's Avatar
OptikalWinsock (sending e-mail) Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

are you sure mail.hotmail.com is supposed to accept connections on port 250? Cuz it doesn't look like it does...
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #4  
Old 03-25-2003, 10:33 AM
JordanChrisWinsock (sending e-mail) JordanChris is offline
Senior Contributor

* Expert *
 
Join Date: Jan 2003
Location: Newbury, UK
Posts: 1,092
Default

Port 25 is possible for SMTP based e-mail. But not port 250.
Reply With Quote
  #5  
Old 03-25-2003, 10:53 AM
Squidge Squidge is offline
Restricted
 
Join Date: Mar 2003
Location: Manchester! England!
Posts: 872
Default

optikal i was wondering is it possible to send e-mail like that? cause that may solve a couple of my problems
Reply With Quote
  #6  
Old 03-25-2003, 03:41 PM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Default

Quote:
Originally Posted by JordanChris
Port 25 is possible for SMTP based e-mail. But not port 250.



Thanks. I changed it to 25 and it works now.
Reply With Quote
  #7  
Old 03-25-2003, 05:26 PM
piggybank1974's Avatar
piggybank1974 piggybank1974 is offline
Ultimate Contributor
 
Join Date: Mar 2002
Location: weston-super-mare(UK)
Posts: 1,795
Default

hi Taz

forget hotmail or any other web based email account you cannot or cannot easily send emails through this unless you are going through there site etc. AOL is a pain for this.

You can tell if it's web based only because it will not work in outlook express etc.

I also have been trying to figure a way around this and come to the solution that AOL,Hotmail,yahoo are crap so get a real mail account.

the pig..
Reply With Quote
  #8  
Old 03-25-2003, 05:30 PM
piggybank1974's Avatar
piggybank1974 piggybank1974 is offline
Ultimate Contributor
 
Join Date: Mar 2002
Location: weston-super-mare(UK)
Posts: 1,795
Default

taz you say you can connect and send emails hmhmhmhm!!

strange this never worked before mind you that was AOL not hotmail but they are similar.

Can you download emails from a program(vb etc not commercial) using your account.

the pig..
Reply With Quote
  #9  
Old 03-25-2003, 06:43 PM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Angry

Quote:
Originally Posted by piggybank1974
taz you say you can connect and send emails hmhmhmhm!!

strange this never worked before mind you that was AOL not hotmail but they are similar.

Can you download emails from a program(vb etc not commercial) using your account.

the pig..




Actually (I just found this out now), it doesn't really work. I can only send an e-mail to me, from me. (That's what I want it to do anyway because it's just an automatic e-mail from the program). It doesn't work when I send it to someone else.

I tried sending an e-mail from someone else's account to their own account, and that didn't work. Does that mean it won't send me an e-mail if I run the program on someone else's computer?

> Can you download emails from a program(vb etc not commercial) using
> your account.

Um, sorry... I don't understand what that means.
Reply With Quote
  #10  
Old 03-25-2003, 06:55 PM
piggybank1974's Avatar
piggybank1974 piggybank1974 is offline
Ultimate Contributor
 
Join Date: Mar 2002
Location: weston-super-mare(UK)
Posts: 1,795
Default

well this looks like the holly grail on what you are trying to do. as mentiond before you seamed to have found a way to connect to a web based server and send mail, but now you say it does not work hmhmhmhm

and retreive it when i tried this with AOL from a friends machine it would not connect..

and other programs will not work with web based mail e.g. outlook as i said.

again I dont know about the last question the only answer is try it .

the pig..
Reply With Quote
  #11  
Old 03-26-2003, 05:31 AM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Unhappy

Quote:
Originally Posted by piggybank1974


again I dont know about the last question the only answer is try it .





I mean, I don't understand what you want me to try. What do you mean by "download e-mail from a program"?
Reply With Quote
  #12  
Old 03-26-2003, 06:00 AM
JordanChrisWinsock (sending e-mail) JordanChris is offline
Senior Contributor

* Expert *
 
Join Date: Jan 2003
Location: Newbury, UK
Posts: 1,092
Default

E-mail systems typically have clients and servers.

The server is where the users mailbox is stored; it is where e-mail messages get delivered to (using the SMTP protocol, on port 25); and it will be connected to the network all the time.
The client can be on your local PC (e.g. Outlook, Outlook Express etc.) or it can be a web-based HTTP client. If it is a local client, then the client will (typically / often / sometimes) down-load the e-mail messages from the server into the local storage of the client before they can be read. This down-load might use MAPI protocol (from the Exchange server) or might use POP3 protocol (to Outlook Express).

The web-client has nothing (apart from the browser) running on the local desktop, so messages are never down-loaded - they are always left on the server.

So the question was: If Hotmail allows you to down-load e-mail messages into a local e-mail client (using POP3 protocol), then it follows that it must also be able to send e-mail (using the SMTP protocol) from the same local client. Therefore, the port 25 SMTP server will be configured for you to send e-mail.

If Hotmail does NOT allow you to down-load e-mail messages, then it is very likely that the only thing that can use the Hotmail SMTP port 25 send e-mail facility is the server that you connect to using the web browser. Your local PC will not have the correct permissions in order to send via Hotmail.

"Here endeth the lesson".
Reply With Quote
  #13  
Old 03-26-2003, 06:06 AM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Default

OK... so, what should I use instead?
__________________
Taz
Reply With Quote
  #14  
Old 03-26-2003, 06:13 AM
rust710 rust710 is offline
Contributor
 
Join Date: Oct 2002
Location: Michigan, USA
Posts: 516
Default

Quote:
Originally Posted by piggybank1974
well this looks like the holly grail on what you are trying to do. as mentiond before you seamed to have found a way to connect to a web based server and send mail, but now you say it does not work hmhmhmhm

and retreive it when i tried this with AOL from a friends machine it would not connect..

and other programs will not work with web based mail e.g. outlook as i said.

again I dont know about the last question the only answer is try it .

the pig..


Piggy. Taz has not hit the holy grail. Hotmail has an SMTP server active and will recive data from it. They used to have a pop3 too but the disabled it because people stopped using the web interface. The hotmail server will only allow email to be sent to hotmail accounts.

But Piggy is right. Get a real email account. There are a few free pop3 + smtp servers out there but your best bet is your account from your ISP.
Reply With Quote
  #15  
Old 03-26-2003, 09:19 AM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Post

Quote:
Originally Posted by rust710

But Piggy is right. Get a real email account. There are a few free pop3 + smtp servers out there but your best bet is your account from your ISP.




Well, I don't have an account from my ISP. My dad does. He doesn't use the computer I use much anymore because he got a new one. He used to get all the e-mails that were meant for me, and he was annoyed by it. That's why I got a hotmail account.
Where can I get these other free servers?
__________________
Taz
Reply With Quote
  #16  
Old 03-26-2003, 05:52 PM
pnklphnts's Avatar
pnklphnts pnklphnts is offline
Junior Contributor
 
Join Date: Feb 2003
Location: University Place, WA
Posts: 274
Default

theres a tutorial on using winsock to send hotmail email here http://www.xtremevbtalk.com/t11406.html
__________________
"Punk rock is freedom" -Kurt Cobian
My Current game Project Black Sun
Reply With Quote
  #17  
Old 03-27-2003, 02:59 PM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Post

Quote:
Originally Posted by pnklphnts
theres a tutorial on using winsock to send hotmail email here http://www.xtremevbtalk.com/t11406.html




The program there is mostly the same as the one I got from www.winsockvb.com, except that the winsockvb one sends the message automatically (the user doesn't type the commands). And it doesn't even work. I don't get any errors like I did before, but the other guy says he didn't get the e-mail. The same thing happened when I sent it to him from his own account (no errors but he didn't get it).
__________________
Taz
Reply With Quote
  #18  
Old 03-27-2003, 05:42 PM
pnklphnts's Avatar
pnklphnts pnklphnts is offline
Junior Contributor
 
Join Date: Feb 2003
Location: University Place, WA
Posts: 274
Default

It works fine for me
__________________
"Punk rock is freedom" -Kurt Cobian
My Current game Project Black Sun
Reply With Quote
  #19  
Old 03-27-2003, 06:02 PM
Taz Taz is offline
Regular
 
Join Date: Mar 2003
Location: Canada
Posts: 70
Default

I just thought of this... It's most likely the problem. My mswinsk.ocx was accidentally deleted before and I had to download it from the internet... Is there more than one version of this file? Maybe I don't have the right one.
__________________
Taz
Reply With Quote
  #20  
Old 03-27-2003, 06:09 PM
piggybank1974's Avatar
piggybank1974 piggybank1974 is offline
Ultimate Contributor
 
Join Date: Mar 2002
Location: weston-super-mare(UK)
Posts: 1,795
Default

have you tried sending the email to yourself??

now I know these questions are stupid but here goes:

are you sure you are logged on to the ISP.

If so you will need to send your Username and Password to the server in that order.

you can then setup and send the information for the:

mailto
mailfrom
body

the return value is 220 if i remember when everthing has gone fine this valure should be checked in your data_Arrival event and there is a returned value of 250 is another one but i cannot remeber what this means at the moment

the pig..
Reply With Quote
Reply


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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sending bitmap or other files over winsock piggybank1974 Communications 7 03-02-2003 06:08 AM
sending mail in HTML format monfu Web Programming 2 02-07-2003 07:43 AM
Sending Mail To all THe clients using Outlook facelessmaster General 0 12-25-2002 01:04 AM
Sending Picture via Winsock Scott Communications 10 11-07-2002 11:40 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail) Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail) Winsock (sending e-mail)
Winsock (sending e-mail)
Winsock (sending e-mail)
 
Winsock (sending e-mail)
Winsock (sending e-mail)
 
-->