Connecting Tech Pros Worldwide Forums | Help | Site Map

local smtp quistion plz

Newbie
 
Join Date: Mar 2009
Posts: 18
#1: Mar 15 '09
how could i configure my local smtp to be able to send eamails via it??
and can i send emails from my yahoo mail or gmail via my local smtp?? that yahoo and gmail have a limitation per day sending via smtp so i want to use my local smtp to break thi limitation

the code i use for this is
Expand|Select|Wrap|Line Numbers
  1. System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage();
  2.             msg.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = "localhost";
  3.             msg.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = "25";
  4.             msg.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = "2";
  5.             //sendusing: cdoSendUsingPort, value 2, for sending the message using 
  6.             //the network.
  7.  
  8.             //smtpauthenticate: Specifies the mechanism used when authenticating 
  9.             //to an SMTP 
  10.             //service over the network. Possible values are:
  11.             //- cdoAnonymous, value 0. Do not authenticate.
  12.             //- cdoBasic, value 1. Use basic clear-text authentication. 
  13.             //When using this option you have to provide the user name and password 
  14.             //through the sendusername and sendpassword fields.
  15.             //- cdoNTLM, value 2. The current process security context is used to 
  16.             // authenticate with the service.
  17.             msg.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = "1";
  18.             //Use 0 for anonymous
  19.             msg.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = "mail@yahoo.com";
  20.             msg.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "password";
  21.             msg.Fields["http://schemas.microsoft.com/cdo/configuration/smtpusessl"] = "true";
  22.  
  23.             msg.From = "mail@yahoo.com";
  24.             msg.BodyFormat = System.Web.Mail.MailFormat.Html;
  25.             msg.To = "mail@yahoo.com";
  26.             msg.Subject = "subject";
  27.             msg.Body = "message body";
  28.             System.Web.Mail.SmtpMail.SmtpServer = "localhost:25";
  29.             System.Web.Mail.SmtpMail.Send(msg);
  30.  
note that this code succeeded when using yahoo smtp but when using localhost it throw an exception

The transport failed to connect to the server.

could u help??

tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,783
#2: Mar 15 '09

re: local smtp quistion plz


Quote:

Originally Posted by Yahoo Help

Q: How many emails can I send via SMTP? Is there a limit?
A: Yes, your outbound email messages are limited to 500 per day, and each message can be sent to no more than 100 contacts at once.
In an effort to help protect all of our customers from spam, Yahoo! has become more aggressive in its requirements around SMTP limits. In addition to placing limits around the number of emails you can send from your desktop email software each day, we reject connections that don't conform to Internet best practices.

http://help.yahoo.com/l/us/yahoo/sma...op/pop-36.html
If you are hitting up against these limits, then I suspect you are trying to build a SPAM system and I doubt anyone here is going to help with that.
Newbie
 
Join Date: Mar 2009
Posts: 18
#3: Mar 19 '09

re: local smtp quistion plz


i am not going to build a spam but i am responsible for advertising in a company and i send messages to thier customers a bout thier products so i need to send the add to all the customers in one day not to send 500 add per day
i hope i can find help
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,783
#4: Mar 19 '09

re: local smtp quistion plz


Quote:
yahoo mail or gmail via my local smtp
This doesn't sound like a corporate job sending mail to their customers. Maybe I'm wrong, but any company with a mailing list of 500 customers a day can just set up their own mail server and would not be going through Yahoo mail or G-mail.

So, if this is a legitimate work need that would be my recommended solution: To use the company's own mail server.
Newbie
 
Join Date: Mar 2009
Posts: 18
#5: Mar 19 '09

re: local smtp quistion plz


dear sir its not a great corporate but at all i think u are going to understand my question "local smtp" this is what i am asking for
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#6: Mar 19 '09

re: local smtp quistion plz


Quote:

Originally Posted by remohy1 View Post

dear sir its not a great corporate but at all i think u are going to understand my question "local smtp" this is what i am asking for

Did you turn on the local SMTP server?
It's a service called "Simple Mail Transfer Protocol (SMTP)" and is part of the iis suite I believe
Newbie
 
Join Date: Mar 2009
Posts: 18
#7: Mar 19 '09

re: local smtp quistion plz


i have configuered it but i dont know how to use it
what is the smtp address that i can use as i used "localhost" but it dont succeded
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#8: Mar 19 '09

re: local smtp quistion plz


You would connect to it through localhost, but there will be no "myname@localhost" emails

This is a .NET1.1 project is it (visualstudio2003)? I've never seen the Fields[] property used like that, so I cannot speak to how that works. I was not aware you could get the old version of the smtp to authenticate either.
Newbie
 
Join Date: Mar 2009
Posts: 18
#9: Mar 19 '09

re: local smtp quistion plz


its working in vs 2005 and vs 2008
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#10: Mar 19 '09

re: local smtp quistion plz


Well System.Web.Mail is depricted after .NET1.1, you should be using System.Net.Mail instead.
Newbie
 
Join Date: Mar 2009
Posts: 18
#11: Mar 19 '09

re: local smtp quistion plz


this is not the problem
my question is that i am responsible for sending adds and that i succesfully send it via yahoo or gmail smtp but i asked can i use my local smtp to avoid limitation of 500 mail per day??
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#12: Mar 19 '09

re: local smtp quistion plz


Well if you are using depricated classes, that are not working, because they were not designed to do what you want....What do you expect a magic solution?
If your local SMTP server is on, I am pretty sure you specify no host or port number and uses them by default. At least thats the way the correct versions of smtp classes are suppossed to work.
Newbie
 
Join Date: Mar 2009
Posts: 18
#13: Mar 19 '09

re: local smtp quistion plz


if i searched the web or someone here helped me to configure local smtp on the right way does it will work on gmail or yahoo mail?
tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,783
#14: Mar 19 '09

re: local smtp quistion plz


Quote:

Originally Posted by remohy1 View Post

this is not the problem
my question is that i am responsible for sending adds and that i succesfully send it via yahoo or gmail smtp but i asked can i use my local smtp to avoid limitation of 500 mail per day??

You have to pick one or the other... You either send through Yahoo as your SMTP host, or your own PC as the SMTP host, or Gmail as the SMTP host, or NetIdenty, or NetFirms...

Wanting to send through Yahoo yet send through your own SMTP doesn't make sense. Its like saying I have to drive my Dodge Ram Pickup, but I still want to do it through my VW bug.
Newbie
 
Join Date: Mar 2009
Posts: 18
#15: Mar 19 '09

re: local smtp quistion plz


so you mean that i cant send from yahoo mail via my local smtp
this makes a problem for me that i wanna recieve the orders on my yahoo mail so i think the result that i have to send 500 mail every day
am i right?
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#16: Mar 19 '09

re: local smtp quistion plz


If you want the reply emails to go to a yahoo account, you either have to rely on some trickery (setting the reply-to address to your yahoo account, which some email programs detect as a spam warning) and using the local smtp server
OR
You have to use the yahoo smtp server, which requires authentication, which means you have to switch to using system.net.mail, and I am not sure yahoo even allows smtp access. Gmail WILL, but you have to "opt in" through the settings section of the webpage
Newbie
 
Join Date: Mar 2009
Posts: 18
#17: Mar 19 '09

re: local smtp quistion plz


Quote:

Originally Posted by Plater View Post

You have to use the yahoo smtp server, with requires authentication, which means you have to switch to using system.net.mail, and I am not sure yahoo even allows smtp access. Gmail WILL, but you have to "opt in" through the settings section of the webpage

i can use gmail mail but what do you mean with
"with requires authentication" at all this is the only way i found on the internet wich allow sending mails via vs005 do you have any other succesful ways that achieve the goal you ment "Gmail allows smtp access" and what does it means?
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#18: Mar 19 '09

re: local smtp quistion plz


It should have said "which requires authentication", meaning you have to "log in" to the smtp server with valid credentials.
GMAIL allows you to use their smtp server if you enable it in the settings page, but they use a special type of smtp server and it also requires encryption
Newbie
 
Join Date: Mar 2009
Posts: 18
#19: Mar 19 '09

re: local smtp quistion plz


do you have a link that explain what you said :
"GMAIL allows you to use their smtp server if you enable it in the settings page, but they use a special type of smtp server and it also requires encryption
"
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#20: Mar 19 '09

re: local smtp quistion plz


Log into your gmail account, and go to settings. Flip through there until you find the section for allowing SMTP access.
You could also just google it, they have plenty of directions about it.
And plenty of people on here have asked questions about using gmail through .NET.
Newbie
 
Join Date: Mar 2009
Posts: 18
#21: Mar 19 '09

re: local smtp quistion plz


thanks alot for helping
Reply