An HTTP proxy can carry an SMTP connection if it permits a CONNECT tunnel to the mail server's port. That permission matters more than whether a webpage loads through the same proxy.

A submission using SMTP with STARTTLS has this general shape:

curl --proxy http://203.0.113.10:8080 --proxytunnel \
  --url smtp://mail.example.com:587 --ssl-reqd \
  --user mail-user \
  --mail-from [email protected] \
  --mail-rcpt [email protected] \
  --upload-file message.eml

The addresses are placeholders. Use a mail service and sender you are authorized to use. curl prompts for the password when the user option contains only the username. The message file needs appropriate mail headers, a blank line, and a body; it is not just the recipient address.

Expect separate connections and logins

The HTTP tunnel option makes curl ask the proxy for a connection to the SMTP destination. The proxy may require its own credentials through curl's proxy-authentication options. The SMTP service then authenticates the mail user inside that connection.

--ssl-reqd requires the TLS upgrade for this SMTP URL. Keep certificate verification enabled for the intended mail hostname. Successful proxy authentication does not establish that TLS or the mail login will succeed.

Many general-purpose HTTP proxies restrict CONNECT ports. A rejection of port 587 can be an intentional policy. Request an approved route rather than repeatedly trying unrelated ports or treating the restriction as an outage.

Mail services can also enforce sender permissions and submission policies after the route is working. Read the SMTP response. A message rejected after authentication requires a different fix from a tunnel rejected before the SMTP greeting arrives.

Winndannde jowitiiɗe heen