Sending image file through the mail

I need example code for sending image/video through the mail.

You can use curl or sendmail command

you can use this busyboxbusybox-armv5l_1.26 (1.1 MB) :

root@swi-mdm9x28-wp:~# chmod 777 busybox-armv5l_1.26
root@swi-mdm9x28-wp:~# ./busybox-armv5l_1.26 sendmail -help
sendmail: unrecognized option: h
BusyBox v1.26.2 (2017-01-10 16:10:07 GMT) multi-call binary.

Usage: sendmail [-tv] [-f SENDER] [-amLOGIN 4<user_pass.txt | -auUSER -apPASS]

Read email from stdin and send it

Standard options:
-t Read additional recipients from message body
-f SENDER For use in MAIL FROM:. Can be empty string
Default: -auUSER, or username of current UID
-o OPTIONS Various options. -oi implied, others are ignored
-i -oi synonym, implied and ignored

Busybox specific options:
-v Verbose
-w SECS Network timeout
-H ‘PROG ARGS’ Run connection helper. Examples:
openssl s_client -quiet -tls1 -starttls smtp -connect
openssl s_client -quiet -tls1 -connect
$SMTP_ANTISPAM_DELAY: seconds to wait after helper connect
-S HOST[:PORT] Server (default $SMTPHOST or
-amLOGIN Log in using AUTH LOGIN (-amCRAM-MD5 not supported)
-auUSER Username for AUTH
-apPASS Password for AUTH

If no -a options are given, authentication is not done.
If -amLOGIN is given but no -au/-ap, user/password is read from fd #4.
Other options are silently ignored; -oi is implied.
Use makemime to create emails with attachments.

Thankyou for your reply,
I’m using curl --url ‘smtps://’ --ssl-reqd --mail-from ‘’ --mail-rcpt ‘’ --upload-file mail.txt --user ‘’ --insecure{This commands only for text}

but i want to send images/videos in mail.please tell you how to send image/video through mail

i am not expert on curl, but you can have a look here: