473,804 Members | 2,959 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net email - setting from name problem

I am sending an email from an asp.net application. I
have set the from address a b@b.com but would like the
name of this user to show up as Big Bob.

How can i tell .net email object that when the user gets
the email i want the from person to be Big Bob. In
exchange the display name for this user is Bob Brown.
Currently users see Bob Brown as the from name field.

Is this possible?
thx
dave
Jul 21 '05 #1
8 4563
Dave,

You can try setting the From to "Big Bob (b@b.com)", and see if that works,
but apart from that, Exchange might still overwrite the display, 'cause
that's what it's got stored...

Thys Brits
MCSD/MCSD.Net

"dave" <dy@onlinelg.co m> wrote in message
news:02******** *************** *****@phx.gbl.. .
I am sending an email from an asp.net application. I
have set the from address a b@b.com but would like the
name of this user to show up as Big Bob.

How can i tell .net email object that when the user gets
the email i want the from person to be Big Bob. In
exchange the display name for this user is Bob Brown.
Currently users see Bob Brown as the from name field.

Is this possible?
thx
dave

Jul 21 '05 #2
Hi Dave,

Firstly I want thank Thys for his good suggestion. I have tested his
suggestion on my side. It works.

using System;
using System.IO;
using System.Web.Mail ;

namespace WebMail
{

class Class1
{

static void Main(string[] args)
{
try
{
MailMessage oMsg = new MailMessage();
oMsg.From = "Jacob Yang" + "(ji***@microso ft.com)";
oMsg.To = "ji***@microsof t.com";
oMsg.Subject = "Here is your report";

oMsg.BodyFormat = MailFormat.Html ;

StreamReader s = new StreamReader(@" d:\largefile.tx t");
oMsg.Body = s.ReadToEnd();
s.Close();

SmtpMail.SmtpSe rver = "smarthost" ;
SmtpMail.Send(o Msg);

oMsg = null;
s = null;
}
catch (Exception e)
{
Console.WriteLi ne("{0} Exception caught.", e);
}
}
}
}

Best regards,

Jacob Yang
Microsoft Online Partner Support
<MCSD>
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #3
I can send an email ok. The problem is that I cannot change the
display name of the individual sending the email.

I have tried the following..

objMail.From = "bo*@bob.co m" & "(Bob Company)"

Exchange still replaces the from name when the email is sent to Bob
Jones not "Bob Company".

I want the from name to be "Bob Company". Is this possible?

thx
dave
Jul 21 '05 #4
Correction.. I have also tried
objMail.From = "Bob Company" & "(bo*@bob.c om)"

This does not work either.

Any ideas?
thx
Jul 21 '05 #5
Hi Dave,

I am sorry if there is any misunderstandin g.

In my testing sample provided in my previous post, the display name in the
"From" is "Jacob Yang [ji***@microsoft .com]". That is the reason why I
stated that "I have tested his suggestion on my side. It works." The code I
am using is:

oMsg.From = "Jacob Yang" + "(ji***@microso ft.com)";

If I use the following code

oMsg.From = "Tim Huang(ji***@mic rosoft.com)";

the display name in the "From" is "Tim Huang [ji***@microsoft .com]"

If you want, I can capture some pictures and send them to you for your
reference.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #6
Are you using MSFT Exchange? I am. Can you send pics to mm*******@yahoo .com?

thx
Jul 21 '05 #7
Hi Dave,

I have sent the picture of my testing result to mm*******@yahoo .com. Please
check it when you have time.
--------------------------------------------------------
From: Jacob Yang
Sent: October 9, 2003 9:55
To: 'mm*******@yaho o.com'
Subject: asp.net email - setting from name problem

Hi Dave,

Thank you for using Microsoft MSDN managed newsgroup.

I noticed the following post in the microsoft.publi c.dotnet.genera l group.

asp.net email - setting from name problem

I am using MSFT Exchange and VS.NET 2003. I have attached the picture of my
testing result for your reference.

<< File: Result.JPG >>
In addition, my testing code is based on the following Knowledge Base
article:

HOWTO: Send E-mail Programmaticall y with System.Web.Mail and Visual C# .NET
http://support.microsoft.com/?id=310273

HOWTO: Send E-mail Programmaticall y with System.Web.Mail and Visual Basic
..NET
http://support.microsoft.com/?id=314201

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------------------------------------------
Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #8
Hi Dave,

My email to mm*******@yahoo .com was rejected. I am not sure about the exact
reason. Would you please provide another email box?

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #9

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

Similar topics

0
9876
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ********************************** package Celcom.Client;
7
4871
by: Christopher J. Hahn | last post by:
I'm trying to use a script-generated form to submit to a script-generated iframe. The problem I'm running into is that the iframe is not assuming the name I assign it. IE6 on Win2000. FF1.0.2+ doesn't seem to have the problem. I'm doing: this.iframe = document.createElement( 'iframe' ); this.iframe.id = this.id + 'wh'; this.iframe.style.display = 'none';
18
18448
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on a remote update of tables and fields and can't find enough information on these things. Also, how do you index a field in code?
11
1868
by: tshad | last post by:
I have a W2003 server running my website and I am trying to set up my pages to send email using System.Web.Mail. I have pages running on this machine using CDONTS that work fine. I am using our exchange server to send the mail but am getting an "Unable to relay" message. But the "From" name is my email address, which is obviously on our exchange server, so there is no relay. The message I get back is:
3
1953
by: Patrick | last post by:
I am dynamically creating TextArea and drop-down lists in ASP.NET using something like HtmlTextArea eachTextArea = new HtmlTextArea(); I tried to set the "name" of these TextAreas, etc. (e.g. <textarea name="NameOfTextArea" rows="5" cols="60">some text area</textarea>), as I want to then dynamically read back the controls' values Setting the ID attributes doesn't work, nor does the following:...
8
290
by: dave | last post by:
I am sending an email from an asp.net application. I have set the from address a b@b.com but would like the name of this user to show up as Big Bob. How can i tell .net email object that when the user gets the email i want the from person to be Big Bob. In exchange the display name for this user is Bob Brown. Currently users see Bob Brown as the from name field. Is this possible?
2
3704
by: Ken Varn | last post by:
I have a managed C++ method that I call from ASP.NET to set the time zone on the local box. I call SetTimeZoneInformation, which does not return an error, but the time zone remains unchanged. I have checked the web for any information on this, but have not found any articles that relate to this specific problem. Can anyone tell me what is wrong here? Here is a sample snippet of the method: Note that TimeZoneInfo is my own managed...
5
2159
by: ibid | last post by:
hi every one just wondering if anyone could help sorry if i seem abit dumb but im a newbie to it all ive got to asign a mail program on my auction site in the config.pl files (i think this is the problem)but im not sure how as i have tryed a couple of things and dont seem to be getting any where the problem is that its just not sending any emails at all no password sent to customers no end of auction i cant send any from the admin either....
1
1794
by: creative1 | last post by:
When I test the application I get follwowing error: could not connect to smtp host: connection timeout error can someone please check if I have rigth settings? Where I am wrong here Is IP and mail host setting ok or not? Contactus.jsp <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN//"> <html>
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9571
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10302
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.