AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Change the "From" mail address in outlook OLE
Thema durchsuchen
Ansicht
Themen-Optionen

Change the "From" mail address in outlook OLE

Ein Thema von Delphi-Lover · begonnen am 31. Mär 2005 · letzter Beitrag vom 31. Mär 2005
Antwort Antwort
Delphi-Lover

Registriert seit: 19. Okt 2004
Ort: Amsterdam
30 Beiträge
 
Delphi 2005 Professional
 
#1

Change the "From" mail address in outlook OLE

  Alt 31. Mär 2005, 13:39
Hello,

With a Delphi program I create an automatic E-Mail message, but the user using the program might have two inboxes in outlook. Like, one of the user self and another that is shared with others. Now when I create an E-Mail the MailItem always takes the Mail-Address of the user. Is there a way to tell the MailItem to use the other sendersaddress. It create the Outlook object in the normal fasion:

Code:
OutlookApplication := CreateOleObject('Outlook.Application');
MailItemSend := OutlookApplication.CreateItem(olMailItem);
MailItemSend.Recipients.Add(email@SomeUser.com');

I like to do this !!!
//MailItemSend.FromAddress:='email@aMailAddress.com';
 
MailItemSend.Subject:=My Subject';
MailItemSend.Body:='Hello Delphi PRAXiS Forum';
MailItemSend.Display;
Thanks,

Rob.
Rob
  Mit Zitat antworten Zitat
Delphi-Lover

Registriert seit: 19. Okt 2004
Ort: Amsterdam
30 Beiträge
 
Delphi 2005 Professional
 
#2

Re: Change the "From" mail address in outlook OLE

  Alt 31. Mär 2005, 14:52
Hello,

I found the answer myself. There is a mailitem property called:

SentOnBehalfOfName

so : MailItemSend.SentOnBehalfOfName:='Name@specialAddr ess.com';

When you display the mailitem you will see an extra line at the top of the mail with the FROM address and a FROM button, like the normal To: and CC: lines. This does NOT mean you can just send an email with another sender address. The address you put in the "SentOnBehalfOfName" property will be verified if you send the message. If you don't have this address attached to your exchange server login. (the current user) then outlook will raise a message that you can not send the email with this address.

Greets and much luck to this PRAXis Website!!

Delphi Lover.
Rob
  Mit Zitat antworten Zitat
Benutzerbild von alcaeus
alcaeus

Registriert seit: 11. Aug 2003
Ort: München
6.537 Beiträge
 
#3

Re: Change the "From" mail address in outlook OLE

  Alt 31. Mär 2005, 14:55
Zitat von Delphi-Lover:
This does NOT mean you can just send an email with another sender address. The address you put in the "SentOnBehalfOfName" property will be verified if you send the message. If you don't have this address attached to your exchange server login. (the current user) then outlook will raise a message that you can not send the email with this address.
Just to make it a bit more precise: You can send an email with any senders address, unless the SMTP server is configured to require a login. By default, SMTP servers don't require that. However, more and more email services require a login before allowing you to send emails. GMX for example requires a logon and cross-checks the submitted from address with the address specified in the account. Therefore, this just depends on the mail server, and not Outlook itself.

Greetz
alcaeus
Andreas B.
Die Mutter der Dummen ist immer schwanger.
Ein Portal für Informatik-Studenten: www.infler.de
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:14 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz