.Net – Sending Email with In Memory Attachment


Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /home/www/danfolkes.com/wp-content/plugins/wp-syntax/wp-syntax.php on line 383

This VB.Net code takes the FileUpload control’s PostedFile and without saving it to the filesystem attaches it to an MailMessage and sends an email.

Advantages:

  • No threading, read/write permissions needed.
  • One line of code.

Front End:

<asp:FileUpload ID="fileUpload" runat="server" />

Code:

Dim m As New MailMessage()
m.Attachments.Add(New Attachment(fileUpload.PostedFile.InputStream, fileUpload.FileName))

TikiWiki – Tracker Email Subject Improvement-Modification

tikiwiki

The template for the Tracker email is here:
\tikiwiki\templates\mail\tracker_changed_notification_subject.tpl

I changed it to this so that it would improve the way it looks in emails:

{$mail_trackerName}{tr} - #{/tr}{$mail_itemId}{tr} modified.{/tr}