350 questions
0
votes
0
answers
45
views
Source Email security with MailMessage and Mail functions (C# and PHP) curiosity question
The work I have been doing for a summer internship has led to me use a couple mail functions, ex: MailMessage and Mail (C# and PHP respectively). A couple sources online have mentioned that C# needs ...
0
votes
1
answer
136
views
MailMessage just spins and spins and never sends in .NET 8 with Office 365
I was following this link here: https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.mailmessage?view=net-8.0&redirectedfrom=MSDN
I have done something similar in the past but I am now ...
0
votes
0
answers
36
views
Not all attachments are added
I've been breaking my head on this for a few days now so I hope you guys see the issue here.
I have a PowerShell script to send mails and it works, but I have issues adding attachments.
When I add ...
-1
votes
1
answer
63
views
Initializing empty MailMessage() causes "Object reference not set to an instance of an object" [duplicate]
I'm using the System.Net.Mail library and am attempting to initialize a MailMessage object. I must initalize it with an empty object because I iterate through a few email addresses to add them into ...
0
votes
0
answers
43
views
MailMessage returns 400 error but anonymous type does not
I wrote a WinForms frontend for an MS Access database that sends project status emails to my employees. Worked great for years using smtp. I'm trying to upgrade the program to use MS Graph API to ...
0
votes
0
answers
55
views
MailMessage - display only From and not Sender
I am creating a System.Net.Mail.MailMessage and sending it using SmtpClient.
I send the email using [email protected], i.e. that is the Sender and From is set to [email protected].
The ...
0
votes
1
answer
164
views
Attaching a attachment to a calendar event using powershell
I am creating a calendar event using powershell. Ideally, I'd like to avoid using modules if possible because I feel like what I'm trying to do is very possible with what I have, but if a module is my ...
0
votes
1
answer
69
views
C# send Email line break in body ignored when using command line
I am using C# MailMessage library to send email but I am facing issues when trying to call this .exe from command line with line breaks in it, it ignores the lines breaks. Can anyone help to find the ...
0
votes
1
answer
534
views
Is there a way to read a .msg file without using x32 libraries in C#?
I am working on a form which has a PictureBox with the DragAndDrop property enabled.
What I want to accomplish is to make the users able to drag an email from the Microsoft Outlook application.
I ...
0
votes
1
answer
24
views
Icalendar no more handled correctly after migration to Exchange Online
A c# process originaly in .net5 was sending email with Ecalendar structure for years but invitations are no more understood for users migrated under Exchange online.
The invitations are still working ...
0
votes
2
answers
105
views
Unable to render the Exchange Email attachment properly after adding as MailAttachment for smtp
I needed to convert an EmailMessage to MailMessage for smtp mail sending. Although if the attachments are files such as .docx, .txt, .jpg etc it displays correctly. The problem I'm facing is that ...
1
vote
1
answer
1k
views
Passing custom data to the email template of laravel notification class
We are sending email notifications using laravel notifications and mailable class.
We have the following process :
** We are using laravel 7 **
We dispatch the JOB
dispatch(new JobEntitiesEmail($arr,$...
2
votes
2
answers
1k
views
Supported way to send office 365 smtp email which allow us to attach a file
I have this code to send email with attachment:-
$encpassword = convertto-securestring -String "*****" -AsPlainText -Force
$cred = new-object -typename System.Management.Automation....
0
votes
0
answers
249
views
Exception calling "Send" with "1" argument(s): The server response was: Cannot connect to SMTP server, connect error 10060"
I have the following code to connect to ExchangeOnline >> generate csv file >> send the file by email using Office 365 smtp:-
Connect-ExchangeOnline
$SiteIDs = '64898c8f-2d5f-4e0e-9a9b-...
0
votes
0
answers
108
views
How to show the sender address in Outlook when sending mail from Java (MailMessageHelper)?
I am using spring MimeMessageHelper and JavaMailSender and when users of my app receive an email, I want to show only the message senders name and not the address. Everything works fine on yahoo, ...
0
votes
1
answer
54
views
SmtpClient MailMessage ignoring Server Mail Flow Rule
I have an Simple Application that Sends and email as Follows:
Private Sub sendEmail()
'create the mail message
Dim mail As New MailMessage()
'set the addresses
...
0
votes
1
answer
735
views
Laravel queued notification doesn't send email
I have notifications that implement ShouldBroadcast and ShouldQueue (I'm using Redis and laravel-echo-server to broadcast notifications). I have to send mail too. So I have toMail method to send the ...
0
votes
3
answers
4k
views
Use html email template and replace variables in MailMessage
I have an html email template in a file and want to replace variables in the template before sending the email. Is there any easy/built-in way of doing that or do I have to read the file contents as a ...
6
votes
1
answer
435
views
SMTP mail with encrypt permission Outlook
When I send a mail with the option "Encrypt only" in Outlook
I receive a mail like this :
Currently, I use SMTPClient with MailMessage to send mail :
MailMessage message = new MailMessage()...
0
votes
3
answers
450
views
Delete draft mail on close when not sent
I've got some draft mails with some buttons to copy and open them. Only a few values need to be filled in and then the mails will be sent. I want to keep the drafts. But if a mail is not sent, I would ...
-1
votes
1
answer
214
views
.NET MailMessage DeliveryNotificationOptions stop working when adding a CC
I recently added a CC to a .NET MailMessage. As soon as I did that the read return receipts stopped working. The read receipts are quite handy as they not only show who has read the message (provided ...
0
votes
0
answers
404
views
how do i use MailMessage with MFA or send emails with MFA enabled?
I am making an app with ASP.Net and I am using Sytem.Net.Mail.MailMessage function to send emails when a new entry is added to the database, but my business is using MFA on its accounts. I was ...
0
votes
1
answer
950
views
Email with Calendar Invite and File Attachment not Rendering on Outlook
I'm trying to send an email using MailMessage on .net framework that has an HTML body, a Calendar Invite, and a File attachment.
I send it to our office365 corporate email and gmail for testing. It ...
2
votes
1
answer
460
views
Error Saving .NET MailMessage With Attachment To File
I am trying to build an error-handling function that will do the following:
Generate an e-mail message (System.Net.Mail.MailMessage object) with an attachment
Save that MailMessage to a file on disk (...
1
vote
0
answers
115
views
LinkedResource fails in MailMessage with CC recipients, succeeds otherwise
I am developing a Windows Background Service with .NET and C#. It periodically queries a REST API and sends emails if certain conditions are met. Sometimes the data returned from the API will have ...
-1
votes
2
answers
567
views
Suddenly getting the error Failure Sending Mail in ASP.Net
I am continuously getting this error failure sending mail. I have already tried by changing port 465/25/587 but nothing worked. My credentials are also correct. All these configurations are for ...
1
vote
0
answers
285
views
MailMessage produces incorrect mail source structure that breaks embedded images on multiple clients
Summary: essentially I ask how to do this in .NET Core 3.1. I have this hierarchy:
multipart/related
├── multipart/alternative
│ ├── text/plain
│ └── text/html
└── image/png
Full ...
1
vote
1
answer
619
views
Attach file from SFTP server using SSH.NET to MailMessage
Is there a way to get this working?
We are getting a file from an SFTP server and we need to email it to someone as part of a CRON automation job.
Here is what I have, but I cannot send the file as an ...
1
vote
0
answers
357
views
Email via .NET MailMessage drops PDF attachment in Windows 10 Mail client
We've received reports of customers getting our emails, but with the attached PDF file missing. It seems this only happens with the Windows 10 Mail application. When viewed in the email provider's web ...
2
votes
1
answer
521
views
PowerShell still locks the file after the end of a script that sends email with attachment
I'm using PowerShell and System.Net.Mail.MailMessage to create email body with an attachment. I found after the end of my script and the email is sent successfully, the target file is still occupied ...
1
vote
0
answers
71
views
MailMessage subject (with non-Ascii characters) not encoded when SMTP DeliveryFormat is International
When SMTP Delivery format is not set to International, it encodes the Subject line correctly.
Sample:
Subject: =?utf-8?B?QmVzdGVsbGVpbmdhbmdzYmVzdMOkdGlndW5nIEJlc3RlbGxl?=
=?utf-8?B?...
1
vote
1
answer
1k
views
Sending an email with @-mention
Is it possible to send an email with @-metion from ASP.Net Core 5.0. If so, does anyone have any idea how to do it?
I've managed to successfully send an email using System.Net.Mail.MailMessage, but I ...
0
votes
2
answers
1k
views
How to convert mails to eml?
Convert mails to EML?
I have a server of which I want to convert mails to EML to backup
How to accomplish this?
Tried the following;
import imaplib
import getpass
import argparse
argparser = argparse....
0
votes
1
answer
5k
views
How Can I Fix System.Net.Mail.SmtpException
This is Image Of ErrorHere is Full Problem System.Net.Mail.SmtpException: 'The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 ...
0
votes
1
answer
156
views
Incorrect text position in HTML email with background image
I have a Console app that sends invitations to new users.
I'm trying to send an HTML email that is just an image with custom text written on top of it.
The HTML file looks like this when you open it ...
0
votes
0
answers
16
views
Getting wrong size of pdf file by mail
I am sending a pdf file size 278kb but I'm getting a file size 5 kb that I can't open... I don't understand where is the problem... this is my code :
MailMessage oMail = new MailMessage();
...
0
votes
2
answers
2k
views
(C#) Image in Mail not displayed in Outlook
I want to send mails with images in them. The code I've written works fine, but for some reason unknown to me it wont work with Outlook clients.
The test mail I sent was (left: Thunderbird, right: ...
0
votes
1
answer
519
views
How to send plain text emails using AlternateView and retain line breaks
I'm sending plain text emails using an AlternateView. The code I'm using is similar to:
var msg = new MailMessage();
var body = $"Test sending\nA newline character\nIn a plaintext email";
...
1
vote
0
answers
510
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
1
answer
259
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 "...
1
vote
2
answers
174
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 ...
1
vote
1
answer
3k
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 ...
1
vote
0
answers
83
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
0
answers
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
0
answers
2k
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
0
answers
288
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
2
answers
1k
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, ...
1
vote
2
answers
3k
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
1
answer
529
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("[email protected]&...
0
votes
2
answers
631
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 ...