C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Visual Studio »

MMS


Posted Date: 06 Aug 2009    Resource Type: Code Snippets    Category: Visual Studio
Author: LaljiMember Level: Diamond    
Rating: 1 out of 5Points: 7



Description :


Create MMS using c#.net


using System;
using System.Collections.Generic;
using System.Text;
using AXmsCtrl;

namespace Mm4Demo
{
class Mm4Demo
{
static void Main(string[] args)
{
MmsProtocolMm4 objMm4Protocol = new MmsProtocolMm4(); // Create instance of COM Object
MmsMessage objMmsMessage = new MmsMessage(); // Create instance of COM Object
MmsConstants objConstants = new MmsConstants(); // Create instance of COM Object
MmsSlide objSlide = new MmsSlide();
MmsMessage objMessage = new MmsMessage();
object obj = null;

objSlide.Clear();
objSlide.AddAttachment(ReadInput("Enter multimedia file (full-path): ", false), ref obj);
objSlide.AddText(ReadInput("Enter body text (optional): ", true));

//Create MMS Message and add slide including text and image
objMessage.Clear();
objMessage.AddRecipient(ReadInput("Enter recipient: ", false), objConstants.asMMS_RECIPIENT_TO);
objMessage.From = ReadInput("Enter sender address (optional): ", true);
objMessage.Subject = ReadInput("Enter subject (optional): ", true);
obj = objSlide;
objMessage.AddSlide(ref obj);

objMm4Protocol.ProviderHost = ReadInput("Enter provider IP/hostname: ", false);
objMm4Protocol.ProviderDomain = ReadInput("Enter provider domain (optional): ", true);
objMm4Protocol.ProviderAccount = ReadInput("Enter account (optional): ", true);
objMm4Protocol.ProviderPassword = ReadInput("Enter password (optional): ", true);
objMm4Protocol.ProviderPort = 25;
// objMm4Protocol.LogFile = "c:\\mmsmm4.log";

// Send
obj = objMessage;
Console.WriteLine("Sending...");
objMm4Protocol.Send(ref obj);
Console.WriteLine("Send, result: " + objMm4Protocol.LastError + " (" + objMm4Protocol.GetErrorDescription(objMm4Protocol.LastError) + ")");

Console.WriteLine("Ready.");
System.Threading.Thread.Sleep(3000); // Sleep for 3 second before exit
}

static private string ReadInput(string strTitle, bool bAllowEmpty)
{
String strInput, strReturn = "";

Console.WriteLine(strTitle);
do
{
Console.Write(" > ");
strInput = Console.ReadLine();
if (strInput.Length > 1)
strReturn = strInput;
} while (strReturn == "" && !bAllowEmpty);

return strReturn;
}
}
}



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
MMS  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Fax Coding
Previous Resource: Convert ascii to Character strings
Return to Discussion Resource Index
Post New Resource
Category: Visual Studio


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use