473,378 Members | 1,067 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,378 software developers and data experts.

default for MailMessage from property

Is there a way of getting the default email address for the logged in user?
I am creating a MailMessage and need a valid from address in order to send
an email in my app with SmtpMail.Send.
Jul 21 '05 #1
1 1408
James wrote:
Is there a way of getting the default email address for the logged in user?
I am creating a MailMessage and need a valid from address in order to send
an email in my app with SmtpMail.Send.


Where do you expect to find an email address for a logged in user? Your
windows account doesn't contain an email address. So you're looking at
the users' email program. That could be outlook (express) or any of the
countless other email programs out there. So unless you demand an
environment variable to be set for your program I don't see a sure fire
way to get the address. Which in the end I don't regret since that makes
it that much harder for emailaddress harvesting worms etc.

You could always enter your own address as from, or fabricate one..
Valid only means valid format like us**@domain.com.

--
Rinze van Huizen
C-Services Holland b.v.
Jul 21 '05 #2

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

Similar topics

1
by: Trond A. S. Andersen | last post by:
Hi all, I'm working on a project in which i need to send mail attachments in the form of Excel documents from a .NET C# application. I've written a class which creates the Excel document using...
1
by: CarlInAl | last post by:
Rather than setting the MailMessage.To and MailMessage.From properties with something like "someName@someDomain.com" I would like to include the name along with the email address. Is something...
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
3
by: Anthony Fine | last post by:
Hello All, I have a VB.Net app that needs to send mail. I have created a class for building my e-mail, but keep getting the error (Could not access 'CDO.Message' object.) when trying to send...
6
by: Jul | last post by:
Hi, I use MailMessage class for create email. I specify such settings: mmEmail = New MailMessage mmEmail.To = ".." mmEmail.Body = "..." mmEmail.Subject = "..." mmEmail.BodyFormat =...
1
by: James | last post by:
Is there a way of getting the default email address for the logged in user? I am creating a MailMessage and need a valid from address in order to send an email in my app with SmtpMail.Send.
2
by: asnowfall | last post by:
I am creating MailMessage out of already existing email message. My existing message has few custom properties. I wan to add them to System.Net.Mail.MailMessage How to add custom properties? ...
2
by: asnowfall | last post by:
I am trying to build System.Mail.MailMessage object out of mime encoded SMTP data. I have following questions Byte byteMailData; //mime encoded STMP data for "email with attachment" 1)...
5
by: Vlad | last post by:
We are trying to set MailMessage Content-Type to be text/calendar The following code has been used: string subject = "Calendar test 3"; MailMessage emailMessage = new MailMessage();...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.