Sunday, February 15, 2009

Send SMS by Sharepoint

i found this sms provider ipip.com
they supported me with this code


private void button1_Click(object sender, EventArgs e)
{
string toPhoneNumber = toTextBox.Text;
string login = fromTextBox.Text;
string password = passTextBox.Text;
string compression = subjectTextBox.Text;
string body = bodyTextBox.Text;


MailMessage mail = new MailMessage();
mail.To = toPhoneNumber + "@sms.ipipi.com";
mail.From = login + "@ipipi.com";
mail.Subject = compression;
mail.Body = body;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", login);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);


System.Web.Mail.SmtpMail.SmtpServer = "ipipi.com";
System.Web.Mail.SmtpMail.Send(mail);



/*set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);*/
}
}
}


http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/bd801d6b-b934-428e-bff1-d52d82cd439e/

1 comment:

Anonymous said...

Thanks for sharing. Notwithstanding, text publicizing can be unfathomably fulfilling and in this article, we will research irrefutably the recommended C# SMS gateway integration that will ensure a smooth and productive bulk SMS advertising campaign for your business.