| Author |  | 
      
        | sbparker31 Newbie
 
  
 
 Joined: 31 January 2011
 Location: United States
 Online Status: Offline
 Posts: 13
 | 
          I am running WebMail Lite, ASP.Net version 5.1.4.
           | Posted: 01 February 2011 at 11:19am | IP Logged |   |  
           | 
 |  
 I have integrated the WebMail system into a web application I have built.  It is functioning as a "Private Email" system (much like you see with Forums).  I would like to be able to send an email to a user's "real" address (outside of their WebMail address) informing them that they have received a private message.
 
 My though was to add a few lines of code to the existing WebMail code that sends the email.  I would lookup in a database the email that is associated with the Private email that the mail is sent to.  I would lookup in the database a flag "Send email notifications".  If there is an email there and the flag is true, I could send the email notification.  I could either create another WebMail message object and use Webmail's send function, or I could just send the email with ASP.NET native SMTP sendmail (which I use for other things already).
 
 So, the question is, where do I find the Webmail "send email" code where I could add this additional code?
 
 Thanks,
 
 Steve
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          To clarify the question: do you need to modify the routine of sending email message and, say, add BCC address
           | Posted: 02 February 2011 at 1:33am | IP Logged |   |  
           | 
 |  to it; or this is about sending one more separate mail message additionally to one which is being sent?
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | sbparker31 Newbie
 
  
 
 Joined: 31 January 2011
 Location: United States
 Online Status: Offline
 Posts: 13
 | 
          This would be sending one more separate email message, additionally.
           | Posted: 02 February 2011 at 4:23am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          The code for sending messages is found in App_Code/Smtp.cs file, the class defined there actually contains only
           | Posted: 02 February 2011 at 4:42am | IP Logged |   |  
           | 
 |  one method called SendMail. Check through this method closely, you'll find out how message and server properties
 are populated. Instead of sending another message from that method directly, you might want to search for SendMail calls
 throughout the code and send your message there by creating another message object and using SendMail for it.
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | sbparker31 Newbie
 
  
 
 Joined: 31 January 2011
 Location: United States
 Online Status: Offline
 Posts: 13
 | 
          Ok, I finally figured it out and got it working.  I had to modify the SendMail method slightly so it called a new method that I wrote that did the database checking, and pulled in a new email address.  I was able to modify the message object with new To:,  Subject, and email Body.  I changed the name of the SendMail method that actually processes the SMTP send call, allow the original SendMail method to call it, as well as the new method I wrote.  And so, two messages are sent -- the original message unmodified, and a new notification method to another email address.  Works like a charm.
           | Posted: 05 February 2011 at 5:12pm | IP Logged |   |  
           | 
 |  
 Thanks Igor, I couldn't have done it without your help.
 
 Steve
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | khoaofgod Newbie
 
  
  
 Joined: 21 April 2011
 Location: United States
 Online Status: Offline
 Posts: 6
 | 
          How about this function on Webmail Lite PHP ?
           | Posted: 21 April 2011 at 1:38pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | khoaofgod Newbie
 
  
  
 Joined: 21 April 2011
 Location: United States
 Online Status: Offline
 Posts: 6
 | 
          I want to add my company slogan under all email send out ( except reply )
           | Posted: 21 April 2011 at 2:21pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          The approach suggested at the end of this forum thread should work for WebMail Lite (PHP).
           | Posted: 22 April 2011 at 12:32am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  |