Send MMS with curl

Send MMS with curl SearchSearch
Author Message
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 6201
Registered: 08-2008
Posted on Friday, December 04, 2020 - 03:52 pm:   

curl is a command-line utility that is frequently used from the command line or scripts to transfer data.

Because it supports HTTP file upload (multipart/form-data), it can provide a very simple interface for sending MMS via NowSMS.


curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image.png -F 'MMSText=This is a test' http://localhost:8800/?user=username&password=password

More than one image:

curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image1.png -F MMSFile=@image2.jpg -F 'MMSText=This is a test' http://localhost:8800/?user=username&password=password

Read text from an existing file:

curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image.png -F MMSFile=@textfile.txt http://localhost:8800/?user=username&password=password

Use image from another web server:

curl -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=http://server/path/image.png -F 'MMSText=This is a test' http://localhost:8800/?user=username&password=password

Specify NowSMS User account (SMS Users) using Authorization header:

curl --header 'Authorization: basic dXNlcm5hbWU6cGFzc3dvcmQ=' -F PhoneNumber=99999999 -F MMSFrom=88888888 -F MMSFile=@image.png -F 'MMSText=This is a test' http://localhost:8800

When using this interface, it is not possible to programmatically assign MIME content types. NowSMS will encode the content type based on well-known file extensions such as .png, .jpg, .jpeg, .gif and .txt. (If necessary, edit MMSCTYPE.INI to define additional types.)

Add Your Message Here, or click here to start a new topic.
Bold text Italics Underline Create a hyperlink Insert a clipart image
Options: Automatically activate URLs in message