Click here to Skip to main content
15,907,329 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C# .net Code( How to send sms from his window project when i am connected bia via internet)
my mail id :-
Posted
Updated 30-Mar-12 2:06am
v5

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search gave over 4.5 million hits.
https://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=send+sms+via+internet+c%23[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;


namespace WindowsApplication1
{
    public partial class Form1 : Form
{

public Form1()
{
    InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
try
{
    MailMessage mail = new MailMessage();
    SmtpClient SmtpServer = new SmtpClient(
    "smtp.gmail.com");
    mail.From = new MailAddress("kamacac87@gmail.com");
    mail.To.Add("cac.kamaraju@gmail.com");
    mail.Subject = "Test Mail";
    mail.IsBodyHtml = true;
    string htmlBody;
    htmlBody = "Hello P.Kamaraju<br>      Write some HTML code here";
    mail.Body = htmlBody;
    SmtpServer.Port = 587;
    SmtpServer.Credentials = new
    System.Net.NetworkCredential("kamacac87", "yakubhai");
    SmtpServer.EnableSsl = true;
    SmtpServer.Send(mail);
    MessageBox.Show("Mail has been sent Successfully.");
}
catch (Exception ex)
{
    MessageBox.Show(ex.ToString());
}
}
}
}



I hope it helps you.
 
Share this answer
 
v2
Comments
bbirajdar 30-Mar-12 8:04am    
The question is regarding sending a SMS and not a email message. Not a answer.
sanjaykumar221@rediffmail.com 21-Apr-12 2:02am    
What is meaning of this code.

System.Net.NetworkCredential("kamacac87", "yakubhai");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900