One of the many useful features of the XyUser Blog is the ability to post formatted code in your posts using the pre tag.

Pre takes two fields, lang (for the language) which is required and lineno (for line numbering) which is optional.

e.g.

Pre tag

lang will take the following:

abap, actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp-qt, cpp, csharp, css-gen, css, d, delphi, diff, div, dos, dot, eiffel, fortran, freebasic, genero, gml, groovy, haskell, html4strict, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, m68k, matlab, mirc, mpasm, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, per, perl, php-brief, php, plsql, python, qbasic, rails, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, xpp, z80

and lineno needs to be given an intial value, eg 1.

This will give the following:

################
## Mail send  ##
################
my $sender = new Mail::Sender
{
smtp => $smtpserv,
};
		$sender->OpenMultipart({from     => 'administrator@letterpart.com',
    to       => $smtp_email_address,
    client => $mailclient,
    subject  => $mesgsubject} ) or die "Error: $!\n";
		$sender->Body(
		{ctype    => "text/html",
    encoding => "7bit",
    msg      => "$email_body" });
		$sender->SendEnc() or die "Error: $!\n";
		$sender->Close() or die "Error: $!\n";

}

If you would like to add support for further languages, please email us and we can supply you with an example .php file to edit and amend.