GetFrom Method

Get sender's friendly name.

[Syntax]
C++: HRESULT GetFrom( BSTR* pVal )
Visual Basic: GetFrom() As String
C#: string GetFrom()

Return Value

This method returns sender's friendly name.

Remarks

If there is no sender's friendly name, this method returns sender's email address.

Usage Example

[C#]
public void ParseSender( string emailFile )
{
  POPMSGClass oMsg = new POPMSGClass();
  string senderName = "", senderAddr = "", replyAddr = "";
  
  try
  {
    if( oMsg.ImportFile( emailFile ) != 0 )
      throw new Exception( "error with ImportFile" );
      
    senderName = oMsg.GetFrom();
    senderAddr = oMsg.GetFromAddress();
    replyAddr = oMsg.ReplyTo();
  }
  catch( Exception e )
  {
    Console.WriteLine( e.Message );
  }
  oMsg = null;
}

See Also

GetFromAddress Method
GetHeaderItem Method


2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.