473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

.NET emailing problem

Okay, this is really annoying me so if you can help I'll
be very gratefull.

I am trying to send an email using the System.Web.Mail
Namespace - MailMessage and SMTPMail classes - and
something very strange is happening.

When I set the EmailFrom field, for example "Joe Bloggs
<jo*******@domain.com>", the angle brackets are converted
to square brackets. I need the angle brackets to stay
angle brackets because email readers only display
the 'Display Name' i.e. "Joe Bloggs". With square
brackets, "Joe Bloggs [jo*******@domain.com]" is displayed
as "Joe Bloggs [jo*******@domain.com]".

Anybody know how I can prevent the conversion from angle
brackets to square brackets?

Regards,

Mark Rodseth.

Nov 18 '05 #1
2 1147
I don't think you can do this because it appears the underlying CDOSYS is
parsing the property and bulding the friendly name and email addrss of the
e-mail message.

If you can't get it working another option is the free SMTP.net component by
Quiksoft. http://www.quiksoft.com/freesmtp/

It will let you do this:

msgObj.From.Name="Joe Bloggs [jo*******@domain.com]";
msgObj.From.Email="jo*******@domain.com";

Bill.

"Mark Rodseth" <an*******@discussions.microsoft.com> wrote in message
news:20****************************@phx.gbl...
Okay, this is really annoying me so if you can help I'll
be very gratefull.

I am trying to send an email using the System.Web.Mail
Namespace - MailMessage and SMTPMail classes - and
something very strange is happening.

When I set the EmailFrom field, for example "Joe Bloggs
<jo*******@domain.com>", the angle brackets are converted
to square brackets. I need the angle brackets to stay
angle brackets because email readers only display
the 'Display Name' i.e. "Joe Bloggs". With square
brackets, "Joe Bloggs [jo*******@domain.com]" is displayed
as "Joe Bloggs [jo*******@domain.com]".

Anybody know how I can prevent the conversion from angle
brackets to square brackets?

Regards,

Mark Rodseth.

Nov 18 '05 #2
I was on completely the wrong track here. Turns out it was the Microsoft Exchange SMTP service which was stripping out headers and tampering in that Microsoft way we love so much.

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul Hudson | last post by:
Ive developed a web based system where somebody can add a news record using ASP and MS Access database connectivity. The new record is inserted into the database and then a formatted email gets...
0
by: Steven Scaife | last post by:
There seems to be a problem with my emailing code, although during testing it worked fine. What happens is it sends two emails instead of one, and also doesn't put any text in the email for some...
2
by: Wayne | last post by:
I am experiencing an intermittent problem when emailing snapshot reports using Sendobject. Outlook opens with the snapshot of the report attached but when I click the "Send" button on the Outlook...
3
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a...
4
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.