Questions tagged [mailmessage]
The MailMessage class can be considered the foundation class of the System.Net.Mail namespace.
321
questions
-1
votes
0answers
19 views
Sending email in .NET through Gmail in another machine [duplicate]
I have created the code to send email from C# through Gmail. It works in my machine after I enabled "Less secure app access" in the email which i sent from address. But when I run my C# app ...
1
vote
0answers
35 views
Email working in Test case but not in IIS (localdev or server)
I have an issue where emails are sent out correctly when executed in unit testing in Visual Studio.
However, the exact same piece of code and configuration does not work on IIS.
Instead I receive a IO ...
1
vote
1answer
34 views
Powershell: Not able to send email using ControlM
I am able to run the below sample script from command line when on the box but facing issues while attempting to run the same script from controlm.
# mailtest.ps1
$cmd='Send-MailMessage -Body "...
0
votes
0answers
17 views
Unicode Display Name is not working with C# email sending with SmtpClient and MailMessage
I am sending emails using the .NET SmtpClient and MailMessage, although when I receive the email in MS Office Outlook (desktop version), the Display Name seems to be not handling accented, Unicode ...
1
vote
2answers
49 views
Powershell - Mail Message Body will not do new lines
I have been racking my brain for hours. All I want is the following.
202011.txt
3 12/28/2020 4:22:56.008 PM Front MOTION
10 12/28/2020 4:23:02.619 PM Joessomebody ...
0
votes
1answer
38 views
MailMessage Attachment to byte[]
I've been searching Google/SO for the past 3 days without success and hoping someone can help or point me in the right direction.
We have a method (with a bunch to overloads) that sends emails. I'm ...
0
votes
0answers
18 views
Stream does not support reading when calling SendEmailAsync [duplicate]
I'm trying to attach a file that's provided in a byte array as an attachment in an email but I'm getting the following error:
Exception: Failure sending mail.
InnerException: Stream does not support ...
0
votes
0answers
26 views
Read from Outllok mailmessages stored on Local Drive [duplicate]
I have some MailMessage Objects Copied to Local Directory Lets Say "C:\Users\admin\Documents\MailSamples".
This address has Outlook MailMessages copied manually from Inbox.
What I want to do ...
0
votes
0answers
25 views
Java, POP3 mail store problem, mail server changes uid values of the messages
Because of business logic demands, we store emails in the database in our java application. We use Java Mail API and use POP3 protocol. We keep a copy of the message on the mail server. When storing a ...
0
votes
0answers
298 views
Using MailMessage to send emails will raise the following errors “Mailbox unavailable” + “Error in processing. The server response”
I have the following code inside my asp.net console application to send an email using office 365 smtp server:-
static private void sendemail(ClientContext context, string subject, string body, string ...
1
vote
0answers
36 views
File appears to be corrupted when added as a mail attachment
I have this property on my model:
public class FileUploadModel {
public HttpPostedFileBase File { get; set; }
}
and I'm trying to add this file as an attachment, like so:
...
foreach(...
0
votes
2answers
73 views
How to exclude or remove a specific e-mail address from a sendEmail function in c#
I'm trying to remove or exclude a couple specific e-mail addresses from the CC e-mail address list. How should I do this? Here is the function:
private void SendEmail(string emailTo, string subject, ...
0
votes
2answers
366 views
Send email with Attachments and Calendar Invite
I am working on service where I want to send emails with attachments(image, pdf, docs) and ics calendar invitation as an alternateview. Whenever I am sending mail with attachments the ics calendar ...
0
votes
0answers
50 views
Send Attachments and AlternateView in a single mail
I am working on a mail service in which I am trying send some image files as an Attachments and ics calendar invitation as an AlternateView. When I add files into Attachments I don't receive ics ...
0
votes
1answer
45 views
C# How to identify unknown user email address in SmtpClient.Send()
I am using the following code to send emails internally at my company on our own relay server:
using (MailMessage em = new MailMessage()) {
em.From = new MailAddress("noreply@mycompany.com&...
0
votes
2answers
44 views
Send-Mailmessage foreach in body
I have a script which gives me back a few usernames in a variable. I need now a mail with a specific text for every user (in one mail).
I get the usernames "abcdef, popefp, nvmwmn"
Lets say ...
0
votes
0answers
21 views
Default windows email client does not allow to send message from my WPF app
I am trying to send an email with an attachment from my WPF application to default Windows 10 mail client. Class MailUtility prepares mail for sending
public static class MailUtility
{
//...
0
votes
0answers
65 views
How to read System.Net.Mail.Attachment.ContentStream properties?
I'm looking for a way to read the Name property of the .NET Attachment.Content Stream I can see the property when I setup a watch, but when I try accessing I don't see the "Name" property show up. I ...
0
votes
0answers
9 views
Is it possible to destruct a System.Net.Mail.MailMessage Attachment?
Is it possible for an application to take in a System.Net.Mail.MailMessage parameter and then get the attachment information from this? What I am wanting to accomplish is to have all of my ...
0
votes
0answers
34 views
C# MailBee MailMessage Properties (extended properties?)
I'm using MailBee.Net 12.1.1.620 (for .net 4.5).
Question regarding properties of MailBee.Mime.MailMessage object. I don't see rather common properties such as: Categories, ConversationIndex, ...
0
votes
1answer
33 views
MailMessage in .NET: why are the <br/> tags being inserted literally into my emails?
I have this email sending function:
''' <summary>
''' Sends an email.
''' </summary>
''' <param name="from">Who is the email coming from?</param>
''' <param name="to">...
0
votes
0answers
15 views
Placing Images behind text in Email message with asp AlternateView
I am trying to position images in a mail I am sending with the use of the "MailMessage" class.
I am using "AlternateView" to connect the messages to the mail itself.
In my "mailBody" I am using an ...
1
vote
1answer
620 views
An image with base64 source won't display properly in email's body [duplicate]
I send email like HTML with option IsBodyHtml = true.
var msg = new MailMessage(fromEmail, firstEmail, email.Subject, bodyText)
{
IsBodyHtml = true
};
Where bodyText is TinyMCE editor parsed ...
1
vote
0answers
157 views
Send Outlook maiItem with Encrypt-Only permission vb.net or powershell
I need send email message via Outlook with permission Encrypt-Only via VB.net or PowerShell.
Permission Encrypt-Only became available in 2018 in Office 365.
https://techcommunity.microsoft.com/t5/...
0
votes
0answers
131 views
xml formatting in an email message
I am trying to send an email with C# code. the body of the email contains both of xml and html tags. email was sent and received successfuly. All HTML tags was being rendered and displayed correctly.
...
0
votes
0answers
188 views
Reply-To Feature is not working as expected in GMAIL when two emails are set to reply to header
In our application, we are using Common From Email address to send an email to all the users.
To receive the reply back from the users, we use Reply to Header and we want users to send an email to 2 ...
0
votes
1answer
94 views
No connection could be made because the target machine actively refused it? while sending message from mvc
I am trying to send a message from my website. This is working fine in my localhost but when i try to publish and host my code it is not running>
MailMessage mm = new MailMessage(email, client_email);...
0
votes
1answer
126 views
Save Email as .eml with original email.body
I am saving my Email using EWS api using the following code. However, when I open the saved .eml and also in .mht format, it is in full text with formatting <tags>.
Is there a way to save the ...
0
votes
1answer
56 views
Save email attachment to excel file corrupts file
I have a System.Net.Mail.MailMessage which contains attachments, when saving them as files all Excel files are corrupt and I cannot open them after.
It works fine with PDF files.
Does anybody have ...
1
vote
0answers
108 views
c# MailMessage From email address display name is not working
I tried to send an email and set display name of the from Email address. But when i received email in my client for instance gmail. Instead of display name i see email address without domain means ...
0
votes
0answers
64 views
Send Gridview as email body in asp.net using C# don't to apply ccs style
I send the Gridview as email body in asp.net using C#.
Everything works correctly, except that in the body of the email the Gridview is not formatted as expected, the style sheet CSS is not applied.
...
0
votes
1answer
133 views
ASP.NET MVC Forget Password email link not formatting as Html
I am trying to set up a forgot password feature, but I can't get the body of the email formatted with links. I think the email is not set up for Html.
void sendMail(IdentityMessage message)
{
...
0
votes
2answers
74 views
How to include `HTML` tags in `MailMessage`
In my Asp.Net application, I am trying to format my outgoing mail message with html tags so that it looks correct when the recipient opens it in their email inbox. Using this post as an example, I ...
0
votes
1answer
476 views
AmbiguousActionException: Multiple actions matched. The following actions matched route data and had all constraints satisfied:
I know there have been more questions about this, but they dont seem to work for me.
I followed the following tutorial: https://www.youtube.com/watch?v=hlZexx2gbNs.
I want to make an email send ...
1
vote
0answers
67 views
UWP: EmailMessage uses comma instead of semicolon
I want to create a new mail in the default mail app using UWP. Therefore I've written the following code:
List<string> emailAddresses = new List<string>();
public MainPage()
{...
0
votes
2answers
78 views
Files in use after sending multiple attachments via SmtpClient/System.Net.Mail
I have an ASP .Net Core 2.2 Web API.
In it, I have a controller that's used by the front end to send emails.
It's using System.Net.Mail.
I've simplified the code as much as possible:
//POST: api/...
1
vote
1answer
278 views
C# Error sending certified mail with System.Web.Mail on Windows Server 2008 R2
Sending certified mail (System.Web.Mail.MailMessage) on port 465 (tls1.2) only fails on windows server 2008 r2
I have a function based on the framework 4.5 but that uses an old library (System.Web....
1
vote
1answer
101 views
Asp.Net MVC Email: An invalid character was found in the mail header
I developed an application that allows sending an email to several recipients. To fetch the emails from the recipients, I am using an autocomplete and separate the various emails by "," Example: aaa @ ...
2
votes
0answers
162 views
Send encrypted AND signed mail with .NET MailMessage in c#
I want to send an encrypted and signed mail without using any third-party library.
I'm able to send an email signed or encrypted. But both is not working.
I've tried to send a mail with Thunderbird ...
0
votes
1answer
61 views
foreach statement in Body MailMessage C#
How would I pass a List through an email body? This is what I have, that returns vehicleNames with a Count. I need to be able to cycle through the Count and get each Name from the list to append to ...
2
votes
2answers
221 views
Reading Mail from many different email platforms on c# windows forms application
I'm trying to read mail from different mail platforms on c#. Many people say:
Microsoft.Office.Interop.Outlook.NameSpace nameSpace =
application.GetNamespace("MAPI");
nameSpace.Logon("", "", Missing....
1
vote
1answer
122 views
MailMessage from MailBee conversion from HTML to TEXT adds extra space
I am using MailBee to convert HTML to Text but it adds an extra space in the beginning of each line except from the first one.
For example I have this HTML
<!DOCTYPE html>
<html>
&...
-2
votes
3answers
307 views
Configure forward-to property for MailMessage like replyto in C#
Is there any way to configure forward-to email address like replyto in System.Net.Mail.MailMessage?
If not then is there any way I can achieve that?
0
votes
0answers
485 views
What's the difference between AlternateView and Attachments in MailMessage?
I have found some sources out there to attach an a base64 as an image and I found some using AlternateView and others using attachments. I used the AlternateView and I found that it still puts the ...
0
votes
1answer
816 views
EWS save sent item in WellKnownFolderName.SentItems
I'm trying to send an EmailMessage using EWS with user A and save the sent item in the SentItems folder of user B. Basically it works. The only problem I encounter, the item is saved as a draft and ...
0
votes
0answers
116 views
Autorization to c# Send Mail via outlook
I want to send emails from my code, I use outlook 2016 from our intranet with Windows authentication.
My code is
public void sendmail ()
{
// Create the Outlook application.
...
0
votes
0answers
33 views
how to send multiple email address [duplicate]
I want to send multiple email address.
What do I have to do. Follow the code below.
const string From = new System.Net.Mail.MailAddress(test@test.com, "<testFrom>");
const string To = new ...
0
votes
0answers
154 views
Failure sending mail. When trying to send email multiple times
I am trying to send email using SmtpClient and MailMessage. I am trying to send email 35 times atleast and out of which 8 are sent and rest 26 shows the following exception:
Failure sending mail.
...
0
votes
0answers
121 views
Google font in MailMessage c# asp.net
Hi is there a way to include a font in the MailMessage from and external URL?
e.g
<link href=""https://fonts.googleapis.com/css?family=Roboto"" rel=""stylesheet""/>
Thank you
1
vote
1answer
41 views
SMTP Attachement only a few bytes sent
I'm trying to attach a image to my email.
I'm doing it this way.
SmtpClient smtpClient = new SmtpClient();
MailMessage mailDSS = new MailMessage();
//Setting From , To and CC
mailDSS.From = new ...