Questions tagged [mailmessage]

The MailMessage class can be considered the foundation class of the System.Net.Mail namespace.

The MailMessage class can be considered the foundation class of the System.Net.Mail namespace.

Instances of the MailMessage class are used to construct e-mail messages that are transmitted to an SMTP server for delivery using the SmtpClient class.

The sender, recipient, subject, and body of an e-mail message may be specified as parameters when a MailMessage is used to initialize a MailMessage object. These parameters may also be set or accessed using properties on the MailMessage object.

The MailMessage class also allows an application to access the headers collection for the message using the Headers property. While this collection is read-only (a new collection can not be set), custom headers can be added to or deleted from this collection.

344 questions
0
votes
1 answer

How to use ASPxFileManager 'SelectedFiles' property to attach files to MailMessage?

I am using DevExpress tools, specifically the FileManager which has a 'SelectedFiles' property which returns all the data needed to (add,insert,delete,retrieve, modify the record). However I can not figure out how to use the selectedfiles as a…
Brad Martin
  • 5,637
  • 4
  • 28
  • 44
0
votes
1 answer

TextControl picture/text/different fonts

I have a problem with formatting: MailMessage mail = new MailMessage(" ", radTextBox_To.Text, radTextBox_Subject.Text, textControl.Text); SmtpClient client = new SmtpClient("smtp.mail.ru"); client.Port = 25; client.Credentials = new…
itprodavets
  • 69
  • 3
  • 9
0
votes
2 answers

powershell - link to attached file in mail message

I can't find the solution for my problem. So, in my send-mailmessage html body is field that should be redirected to file which is included as attachment in message. How can I create hyperlink to that file in mail, when client opens it? I don't know…
safazaurs
  • 1
  • 2
0
votes
1 answer

VisualBasic How to Send Base64

Right I am stumped as hell and I don't even know what I am doing is right. I have some Base64 code of an image which I am emailing using Visual Basic (codes below) but when I recive the email its just shows the box and red cross. My knowlage is very…
MrFuji87
  • 5
  • 5
0
votes
3 answers

File is used by another process exception C#

I have created an application that generates excel files from information in a database. These files are saved on my HDD in a folder. After that I attach the files and send them via mail. When I generate another batch of files I delete the old…
Lahib
  • 1,305
  • 5
  • 34
  • 62
0
votes
0 answers

c# MailMessage dependent on the content of the subject?

This is weird! I'm trying to send an email using MailMessage through an SmtpClient and I'm getting some strange results! Here's what's going on: 1) This works on some emails but not on others. 2) I've narrowed it down to some problems with some…
stevekershaw
  • 155
  • 1
  • 5
  • 15
0
votes
1 answer

More advanced .NET HTML Encoding

I am looking for an HTML encoder that is a little more thorough than .NET's HtmlEncode method. That method will handle <> but not long dashes, which is causing me problems. Is there a .NET library out there that encodes all special characters into…
Mark Williams
  • 583
  • 7
  • 18
0
votes
1 answer

Question marks instead of dashes

I have a program that runs on .NET. A client is having a problem that appears to be an email encoding issue. Question marks are showing up in the email body; I've changed the encoding to UTF. Still a problem. CHARLOTTE, N.C. (AP) — The…
Mark Williams
  • 583
  • 7
  • 18
0
votes
3 answers

Sending repeater in an email

I need to send a table obtained using a repeater in a mail, are there examples on how embed a repeater in a mail body? I'm using MailMessage to send the mail. I tried to implement this example: System.IO.StringWriter stringWrite = new…
Camilla
  • 949
  • 2
  • 14
  • 26
0
votes
3 answers

attaching a file to a message

I created an html using string builder and placed it in the current directory StreamWriter sw = new StreamWriter("../../Data.html"); Now I want to attach this file and send it as a mail. How can I add this as an attachment to my email? This is what…
Arianule
  • 8,811
  • 45
  • 116
  • 174
0
votes
1 answer

Mask From Email Address smtp asp.net gmail

I am using MailMessage to send email from a web application. I believe I have the correct code in to "mask" the from name in the SendEmail() function public static void SendEmail(string toAddress, string ccAddress, string bccAddress, string subject,…
Jon Harding
  • 4,928
  • 13
  • 51
  • 96
0
votes
1 answer

ASP.net 3.5 Website Using ASP:Wizard Control and SMTPClient does not send Email

I have a asp:Wizard control on a site running Framework 3.5. I acquired the settings from the web host and have entered them into the Web Configuration Utility. Here's the code behind file: Protected Sub Wizard1_FinishButtonClick(ByVal sender As…
SidC
  • 3,175
  • 14
  • 70
  • 132
0
votes
2 answers

F# NameValueCollection to Map

I have a NameValueCollection which I need to convert to a Map and I just can't work it out. I tried: let headerMap (m : MailMessage) = m.Headers |> Map.map (fun k v -> v.[k]) Do I need to use Seq.map instead? Basically the point of this is that I…
shmish111
  • 3,697
  • 5
  • 30
  • 52
0
votes
2 answers

Anybody knows how to send SSL emails with System.Net.Mail through GoDaddy email servers

I researched this on SO and could not find a truly complete answer. Many people, including myself, are able to send an email through C# System.Net.Mail by using port 25 or 587 and NOT using SSL. For example, see…
Damiano Fusco
  • 215
  • 3
  • 6
0
votes
1 answer

Unexpected 'Invalid Email Address Format'

I have the following line of code to add a To address to a MailMessage instance. (The Xs in the string represent placeholders for alphabetic characters to prevent the identify of a customer.) message.To.Add("Xxxxxxxxx Xxxxxx Xxxxxxxxxx, Xxx.…
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
1 2 3
22
23