i am starting a new forum , and right now i am making a welcome email to be sent to users on registration ,
i dont know how to make a welcome email that contains pictures and links , i have tried to send some emails to my self writing in it some html codes that displays pics but all i get is the code it self!!!
can anyone help me with this , all i want to do is some pics , links and some font editing.....
marwan4 0 Newbie Poster
Dani AI
Generated
Seeing raw HTML in the received message almost always means the mail was sent as plain text or the HTML was escaped. is correct to focus on the Content-Type header; for the usual culprits are: the forum/template system forcing plain-text output, the mailer escaping HTML (htmlentities/htmlspecialchars), or building the message with incorrect MIME boundaries or line endings.
A practical approach:
- Prefer a mail library (PHPMailer, SwiftMailer, etc.) rather than hand-constructing headers. Libraries handle MIME, boundaries, encodings and SMTP reliably.
- Send a multipart/alternative message so recipients get a plain-text fallback plus an HTML part. Use UTF-8 and a sensible Content-Transfer-Encoding (quoted-printable or base64) for non-ASCII characters.
- Host images with absolute HTTPS URLs and use inline <img> tags. If images must be embedded, use CID embedding (multipart/related) — libraries provide addEmbeddedImage-style helpers.
Example (PHPMailer-style pseudocode — not the raw mail() approach shown earlier):
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = 'smtp.example.com';
$mail->setFrom('no-reply@example.com');
$mail->addAddress($userEmail);
$mail->isHTML(true);
$mail->Subject = 'Welcome';
$mail->Body = '<h1>Welcome</h1><p><img src="https://example.com/logo.png" alt="Logo"></p>';
$mail->AltBody = 'Welcome — plain text version';
$mail->send(); Rendering tips and quick checks:
- Use inline CSS and simple table-based layout for reliable rendering; avoid external stylesheets, JavaScript and forms.
- Include useful alt text and keep key info in the plain-text part because many clients block remote images by default.
- Debug by viewing the raw message/source in the mail client to confirm the Content-Type and boundaries. If using raw mail(), ensure CRLF line endings (\r\n) and no extra blank line before headers.
- If the HTML still shows up as code, search the send path for escaping functions (htmlentities, strip_tags) or a template engine that sanitizes output.
Following those steps will make a welcome email with images and links render correctly across clients.
MattEvans 473 Veteran Poster Team Colleague Featured Poster
are you using forum software? does it let you change the content type/header of the email? In the header, a plaintext email has : Content-type:text/plain, and an HTML email has: Content-type:text/html. some email accounts turn HTML emails into an attachment aswell.
if there's no setting in the forum software, look for the module that deals with email, and look for the part that generates the mail. in php it'll be something like:
$to = "matt-at-somewhere.com";
$headers = 'Subject: lalala\n";
$headers .= 'From: matt-at-somewhere-else.com\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n";
$body = 'the message';
mail($to,$title,$body,$headers); in perl it'll be something like:
open(MAIL, "|/usr/sbin/sendmail -t ");
print MAIL "From: #hidden#\n";
print MAIL "To: #hidden#\n";
print MAIL "Reply-To: #hidden#\n";
print MAIL "Content-Type: text/plain\n";
print MAIL "Subject: lalala\n\n";
print MAIL "[Start of message; this message is an automated message. You should reply to #hidden#]\n\n";
print MAIL "[End of message; this message is an automated message. You should reply to #hidden#]";
close(MAIL); Set the content-type to HTML by whatever means, and your message will be HTML.
EDIT: quick disclaimer; I can't be held responsible for any damage to your forum should you follow my instructions =P they should be considered "informative". of course, you should make backups before you change anything. but that aside, provided your forum software is script based, it should be a very simple thing to change. finding it in the first place will be hard part.
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.