what is smtp host name for sending mail using yahoomail ID?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kapil Choubisa
    New Member
    • Sep 2009
    • 47

    what is smtp host name for sending mail using yahoomail ID?

    Hello all
    I am using smtp for sending mail.
    it ask the smtp host name. that is
    Code:
     smtp.Host = "smtp.gmail.com";
    what is for yahoo/rediff/hotmail

    is there any one for globle mail systems.

    the other problem is it ask for Credentials
    I have to give my gmail user name and password which I donn want to supply.
    Code:
     smtp.Credentials = new System.Net.NetworkCredential
                 ("yourgmailemailID@gmail.com", "yourGmailPassword");
    plz help me to come out thi problem.

    thank you
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Whether it is outlook, or Microsoft mail, or Thunderbird mail, or the program you make to do mail... you have to tell it what email account to use.

    That email account consists of a server, account name and password. That is the nature of email.

    Comment

    • Kapil Choubisa
      New Member
      • Sep 2009
      • 47

      #3
      I am Talking about mail sending in Asp.Net using C#.
      I have the following code
      Code:
      using System.Net.Mail
      Code:
       MailMessage mail = new MailMessage();
              mail.To.Add("kkapilchoubisa@gmail.com");
              mail.From = new MailAddress("kkapilchoubisa@rediff.com");
              mail.Subject = "hi";
              mail.Body = "Hello dear hw r u";
              SmtpClient smtp = new SmtpClient();
              smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
              try
              {
                  smtp.Send(mail);
              }
              catch
              {
              }
      It generates no exception but kkapilchoubisa@ gmail.com can not get any email.

      I have another code:

      Code:
      using System.Net.mail;
      Code:
       MailMessage mail = new MailMessage();
      
              mail.To.Add("kkapilchoubisa@gmail.com");
      
              mail.From = new MailAddress("kkapilchoubisa@rediff.com");
      
              mail.Subject = "Test Email";
      
              mail.Body = "This is a test mail!!";
      
              string atch = Server.MapPath("problem.docx");
              mail.Attachments.Add(new Attachment(atch));
              SmtpClient smtp = new SmtpClient();
            
              smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address   587
         
              smtp.Credentials = new System.Net.NetworkCredential
                 ("yourGmailID@gmail.com", "yourGmailPassword");
              //Or your Smtp Email ID and Password
              smtp.EnableSsl = true;
              smtp.Send(mail);
      this code runs successfuly. Please tell me what can I do in my first code by which I avoid to pass my EmailId and Password.


      These all is in Asp.net using C# code

      Thanks

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Please tell me what can I do in my first code by which I avoid to pass my EmailId and Password.
        You can't. It doesn't matter if you are using ASP or BASIC. Email requires an account. It has to be sent from someone.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          SMTP servers generally will NOT send mail to an email account it does not controll, without first logging in as a valid user.

          For example:
          If i send mail with smtp.mydomain.c om, I can probably send email to JoeUser@mydomai n.com without "logging in", but if i wanted to send an email to JoeUser@gmail.c om, then I would need to authenticate with smtp.mydomain.c om (possibly as say plater@mydomain .com and then a password) in order to send out the email.

          Comment

          Working...