Results 1 to 6 of 6
  1. #1

    Default smtp c# emailing.


    Code:
    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
    message.To.Add("evulbalangaw@gmail.com");
    message.Subject = "This is the Subject line";
    message.From = new System.Net.Mail.MailAddress("From@online.gnu.com");
    message.Body = "This is the message body";
    System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtpServer");
    smtp.Send(message);
    I got the code fragment above from googling.

    How would I know my smtpServer?

    I tried using gmail's smtp directly but it gave me this error
    Code:
    Service not available, closing transmission channel. The server response was: Cannot connect to SMTP server 216.239.59.109 (216.239.59.109:25), connect error 10060
    If you would use XAMPP, how do you configure the smtp and know the server address of the smtp? or maybe in general?

  2. #2
    Try daw ni bai..
    this is using gmail smtp.. then change the network credentials with your gmail account username and password..

    System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();

    message.To.Add("evulbalangaw@gmail.com");
    message.Subject = "This is the Subject line";
    message.From = new System.Net.Mail.MailAddress("From@online.gnu.com") ;
    message.Body = "This is the message body";

    System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com""); // Fix for using gmail
    System.Net.NetworkCredential netCred= new System.Net.NetworkCredential("myEmail@gmail.com"," myPass"); // Change to your own gmail account

    smtp.EnableSsl = true;
    smtp.UseDefaultCredentials = false;
    smtp.Credentials = netCred;
    smtp.Port = 587; // or 465
    smtp.Send(message);

    Good Luck...

  3. #3
    Junior Member
    Join Date
    May 2007
    Gender
    Male
    Posts
    322
    How would I know my smtpServer?
    I think that would be the IP Address of your SMTP server or your email server IP address.
    Last edited by torade; 03-27-2009 at 09:38 AM. Reason: added some text

  4. #4
    Im using postfix mail server. My problem is my mails are stuck on a queue. What are the probable causes of this?

  5. #5
    Bump Bump.heheh help unta..kay google is a bit messy when it comes to this.

  6. #6
    ahhhhh..gmail nalang ko oi..hehehe close na ni.tnx

  7.    Advertisement

Similar Threads

 
  1. Port 25/SMTP problem
    By MelodyMan in forum Networking & Internet
    Replies: 30
    Last Post: 11-22-2005, 12:36 PM
  2. www.goowy.com email nga flash gigamit para sa interface nila
    By zengatsu in forum Websites & Multimedia
    Replies: 5
    Last Post: 10-08-2005, 05:38 PM
  3. AOL free email (welcome to the club)
    By noelting in forum Websites & Multimedia
    Replies: 10
    Last Post: 05-21-2005, 08:28 PM
  4. receive lotto results via email
    By the KG in forum Websites & Multimedia
    Replies: 5
    Last Post: 05-07-2005, 01:59 AM
  5. Earn Extra $10+ while reading email!
    By Goldenfox in forum Websites & Multimedia
    Replies: 3
    Last Post: 05-01-2005, 06:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top