473,791 Members | 3,229 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 4562
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
4869
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
18421
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
1866
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
3703
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
2157
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
1793
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
9666
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
9512
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
10201
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
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
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5424
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
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.