can anyone please tell me how I can send email with freeBSD?

I guess the:

mail -s " subject" is for system internal mail only???

do i need to browse my for example hotmail.com ,,, login and then create the email from there? ..... or if there is a better way to send an email? thanks

Dani AI

Generated

Short answer: you do not have to use Hotmail/webmail. The system tool you tried hands mail to an MTA (Mail Transfer Agent). To send external mail from FreeBSD you can either run a full MTA on the host or use a small SMTP client that relays through an external SMTP server. pointed toward the system MTA; below are practical, current options and gotchas.

If you want a full mail server (handles queues, incoming mail, multiple apps) install an MTA such as Postfix or Exim. Postfix is easier to run for most admins. Typical quick steps (as root):

pkg install postfix
sysrc postfix_enable=YES
service postfix start

Then edit /usr/local/etc/postfix/main.cf for your hostname and relay settings. See the Postfix docs for configuration details: Postfix and FreeBSD handbook material here: FreeBSD Handbook.

If you only need to send outbound mail (no incoming mail), use a lightweight SMTP client and relay via an existing SMTP account (ISP, Gmail, etc.). msmtp is a simple choice; example ~/.msmtprc:

account default
host smtp.example.com
port 587
auth on
user you@example.com
password your_app_password
tls on

Protect that file (chmod 600) and test sending with msmtp or a mail client that uses it. msmtp docs: msmtp.

Important cautions: many residential IPs are blocked by mail providers; use your ISP or a trusted SMTP relay. Running an open/poorly configured MTA risks being an open relay or getting listed on blacklists. For reliable delivery configure PTR (reverse DNS), SPF, and DKIM, and test SMTP connectivity (tools like swaks or openssl s_client -starttls smtp help).

FreeBSD, like most *nixs, requires a Mail Transfer Agent (MTA) to send external mail. On FreeBSD, sendmail is setup as the default MTA, so you should probably learn how to use that before trying out other MTAs. The FreeBSD handbook covers the configuration of sendmail fairly well:

http://www.freebsd.org/doc/en/books/handbook/sendmail.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.