Re: Email Programming using System.Web.Mail



Ed,

This is how I attach files to eMails sent via System.Net.Mail:
Private Sub AddAttachment(ByRef message As MailMessage, ByVal sFile As
String)
Dim attFile As Attachment
Dim disposition As ContentDisposition

attFile = New Attachment(sFile)
disposition = attFile.ContentDisposition
disposition.CreationDate = System.IO.File.GetCreationTime(sFile)
disposition.ModificationDate =
System.IO.File.GetLastWriteTime(sFile)
disposition.ReadDate = System.IO.File.GetLastAccessTime(sFile)
message.Attachments.Add(attFile)
End Sub

The MailMessage object does have a Bcc property, so you can add Bcc adresses
(don't know how many):
Dim adrBcc As MailAddress

adrBcc = New MailAddress("add1@xxxxxxxx")
message.Bcc.Add(adrBcc)

adrBcc = New MailAddress("add2@xxxxxxxx")
message.Bcc.Add(adrBcc)
...

Hope this helps,
Thomas


"Ed Bitzer" <edbitzer@xxxxxxxxx> schrieb im Newsbeitrag
news:u03VHQGWIHA.484@xxxxxxxxxxxxxxxxxxxxxxx
I have been able using the namespace System.Web.Mail and its method
Smtp.mail.send to mail simple text messages to a small group within
our 55 and older community. I need help expanding the programs
capabilities. Searching this forum I did not find any related
information so if I have chosen poorly, I would appreciate a
suggestion of a more appropriate dotnet forum.

Now what I wish is the ability to send bcc's rather than to: (would be
sending to all 250 residents and would have to send in groups of 50 as
required by Comcast to curtail spammers) and also wonder if this
namespace handles base64 encoding so that I can send a pdf attachment.
Appreciate,

Ed









.



Relevant Pages

  • RE: SMTPMAIL Format & File Link??
    ... Dim newMail As New MailMessage ... Also make sure the mail server you are sending through and the destination mail server support html email. ... > Dim stringMessage As String ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Email Programming using System.Web.Mail
    ... The types I'm using (MailMessage, Attachment) are part of that namespace. ... Dim disposition As ContentDisposition ... Dim adrBcc As MailAddress ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Emailing a GridView
    ... Option Explicit ON ... ToString is not the magic cure-all for getting "stuff". ... Dim SB As New StringBuilder ... Dim mm As New MailMessage() ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Emailed error reports
    ... MailMessage and SmtpServer classes. ... Public Sub NotifySampleLoad() ... Dim cn As New SqlConnection ... Dim subject As String = "Sample Load Notification" ...
    (microsoft.public.dotnet.languages.csharp)

Loading