MMS

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;
}
}
}


Comments

Author: Praveen M.S06 Feb 2011 Member Level: Bronze   Points : 0

Kindly send the AXmsCtrl.dll file to my e-mail id
pravinms07@yahoo.co.in

Guest Author: ManoPrassana29 Mar 2012

i need AXmsCtrl.dll ,plz send that dll

Guest Author: Laercio Tersi17 Aug 2012

Kindly send the AXmsCtrl.dll file to my e-mail id
laercio.bnc@gmail.com

Por gentileza poderia enviar essa dll AXmsCtrl.dll para o meu e-mail abaixo muito obrigado.
laercio.bnc@gmail.com



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: