Questions tagged [asp.net-mail]
17 questions
2
votes
2 answers
How to Set SMTP Client in POSTAL MVC not in WEB.Config
i have a problem when using POSTAL MVC in my Project. My hosting services company requires me to set smtp client config in code not in web config.
How to do that ?
I hope someone can give me a solution
Thank you.

Handaru Eri Pramudiya
- 135
- 1
- 11
2
votes
2 answers
How to attach an Xml to .net Mail Attachment using MemoryStream?
I have a cshtml view in mvc filled with xml such as :
@model myproject.net.Models.mymodel
@{
Layout = null;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; " + "filename=" +
…

Berker Yüceer
- 7,026
- 18
- 68
- 102
2
votes
2 answers
How to check if email was delivered using C# MailMessage
I am using below code to send email it works fine most of the time & during test we found sometimes it doesn't deliver email. How can i alter this code to check the email delivery status or font any other failure.
public static void…

Learning
- 19,469
- 39
- 180
- 373
1
vote
2 answers
HTML in email body showing as HTML itself. Not rendering ASP.NET Mail
Im facing a little trouble when sending emails from ASP.NET (VB). Here is the code Im on
Using mm As New MailMessage("myemai@abcd.com", mc.mailTo)
If mc.mailCC.Trim <> "" Then
mm.CC.Add(mc.mailCC)
…

Sandeep Thomas
- 4,303
- 14
- 61
- 132
1
vote
1 answer
how to send form data in orchard CMS
I'm using a form in my orchard website. How i can sent the form data to an email
address?
My form is like

user6144292
- 163
- 5
1
vote
1 answer
MVC 4 Password Recovery
First I am quite new to MVC and I am trying to implement a password recovery functionality for MVC 4. I am implementing this using this technique posted here: Where to find C# sample code to implement password recovery in ASP .NET MVC2
I understood…

David Dury
- 5,537
- 12
- 56
- 94
1
vote
1 answer
Sending email with C# .Net error 5.7.1
I was trying to create a function that emails to target address when used.
my email model:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.Net.Mail;
using…

Berker Yüceer
- 7,026
- 18
- 68
- 102
0
votes
1 answer
Form is not checking model state or clearing form after submit
I have had a couple of questions on this issue. However, now I have redone my code and almost all of it is working. The only issue is after the for is submitted it is not checking the model state, because even when the form is successful it displays…

Lars Hovden
- 317
- 2
- 25
0
votes
2 answers
ASP.NET MVC Email Contact Form
I am creating a contact form for customers to type info in the form and submit an email to us. Also, my hosting package is under Go Daddy. I used the following code as a test and it worked.
MailMessage oMail = new System.Web.Mail.MailMessage();
…

Lars Hovden
- 317
- 2
- 25
0
votes
2 answers
Return message after form is submitted
I am sorry if this has been posted before. I have searched many websites and forms to fix it but I can not get it. I have a simple contact form that allows potential customers to fill out their info click submit and then email a copy of what they…

Lars Hovden
- 317
- 2
- 25
0
votes
0 answers
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 =…

John John
- 1
- 72
- 238
- 501
0
votes
1 answer
Embedding Multiple Images in Email Displays only Last Image C#
I need to embed 5 links in a row with images in a MailMessage using C#. The problem is only the last embedded image displays in the email. The result I need is this:
Here is what displays in the delivered email:
Here is my code:
public void…

Rani Radcliff
- 4,856
- 5
- 33
- 60
0
votes
2 answers
Email a Friend functionality in MVC
Pretty much there would be an icon on the site. clicking it would bring up a pop up window with following fieds:
Name
Email
you would then be able to fill out the page and an email would be sent to "email" provided in the "Email" field. The…

ShaneKm
- 20,823
- 43
- 167
- 296
0
votes
1 answer
Send email to selected/searched members on listbox in c#
I have created a form with a list box called lstCompany which displays search data, search textboxes are the "Name" and "PostCode" of company. I have a table called tblCompany which contains CompanyNo(primary key) with company details in the…
0
votes
2 answers
Mvc .Net.Mail: How to send email with image (logo)
I am using three classes to send email but i cant to combine text email with image, or just to send image. When i get email i see empty image.
Help me to change my code so i can to send email with:
text
image
and style
public class SendService :…

Aleksei
- 29
- 1
- 5