1999-08-27 01:50:46 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-08-27 01:50:46 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-08-27 01:50:46 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-08-27 01:50:46 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-08-27 01:50:46 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nsIFileSpec.idl"
|
|
|
|
|
|
|
|
interface nsISmtpServer;
|
|
|
|
interface nsIURI;
|
|
|
|
interface nsIUrlListener;
|
|
|
|
interface nsISupportsArray;
|
1999-11-09 05:04:06 +03:00
|
|
|
interface nsIMsgIdentity;
|
2000-02-16 08:59:51 +03:00
|
|
|
interface nsINetPrompt;
|
1999-08-27 01:50:46 +04:00
|
|
|
|
|
|
|
[scriptable, uuid(FBAF0F10-CA9B-11d2-8063-006008128C4E)]
|
|
|
|
interface nsISmtpService : nsISupports {
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// SendMailMessage requires the file name of the message to send, the
|
|
|
|
// sender, a comma delimited list of recipients.
|
|
|
|
// It builds an Smtp url, makes an smtp connection and runs the url. If you
|
|
|
|
// want a handle on the running task, pass in a valid nsIURI ptr. You can
|
|
|
|
// later interrupt this action by asking the netlib service manager to
|
|
|
|
// interrupt the url you are given back. Remember to release aURL when you
|
|
|
|
// are done with it. Pass nsnull in for aURL if you don't care about
|
|
|
|
// the returned URL.
|
|
|
|
//
|
|
|
|
// If you don't care about listening to the url, feel free to pass in
|
|
|
|
// nsnull for that argument.
|
|
|
|
//
|
|
|
|
// You can also pass an SMTP server as an argument if you want to send
|
|
|
|
// this message with a specific server.. otherwise it will use the
|
|
|
|
// default server
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-02-16 08:59:51 +03:00
|
|
|
void SendMailMessage(in nsIFileSpec aFilePath, in string aRecipients,
|
|
|
|
in nsIMsgIdentity aSenderIdentity,
|
|
|
|
in nsIUrlListener aUrlListener,
|
|
|
|
in nsISmtpServer aServer,
|
|
|
|
in nsINetPrompt aNetPrompt,
|
1999-08-27 01:50:46 +04:00
|
|
|
out nsIURI aURL);
|
|
|
|
|
1999-10-05 07:29:42 +04:00
|
|
|
/**
|
|
|
|
* A copy of the array of SMTP servers, as stored in the preferences
|
|
|
|
*/
|
1999-09-14 11:03:47 +04:00
|
|
|
readonly attribute nsISupportsArray smtpServers;
|
1999-10-05 07:29:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The default server, across sessions of the app
|
|
|
|
* (eventually there will be a session default which does not
|
|
|
|
* persist past shutdown)
|
|
|
|
*/
|
1999-09-20 03:58:57 +04:00
|
|
|
attribute nsISmtpServer defaultServer;
|
1999-10-05 07:29:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* create a new SMTP server.
|
|
|
|
* Use this instead of createInstance(), so that the SMTP Service can
|
|
|
|
* be aware of this server
|
|
|
|
*/
|
1999-09-14 11:03:47 +04:00
|
|
|
nsISmtpServer createSmtpServer();
|
1999-10-05 07:29:42 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* find the server with the given hostname.
|
|
|
|
* @param hostname the hostname of the server
|
|
|
|
* @returns null if no server is found
|
|
|
|
*/
|
2000-05-10 10:44:06 +04:00
|
|
|
nsISmtpServer findServer(in string username, in string hostname);
|
1999-10-05 07:29:42 +04:00
|
|
|
|
2000-02-23 12:42:54 +03:00
|
|
|
/**
|
|
|
|
* look up the server with the given key
|
|
|
|
* if the server does not exist, create it and add it to our list
|
|
|
|
*/
|
|
|
|
nsISmtpServer getServerByKey(in string key);
|
|
|
|
|
1999-10-05 07:29:42 +04:00
|
|
|
/**
|
|
|
|
* delete the given server from the server list.
|
|
|
|
* does nothing if the server does not exist
|
|
|
|
* @param server the server to delete. Use findServer() if you only know
|
|
|
|
* the hostname
|
|
|
|
*/
|
1999-09-14 11:03:47 +04:00
|
|
|
void deleteSmtpServer(in nsISmtpServer server);
|
2000-02-01 03:05:02 +03:00
|
|
|
|
1999-09-14 11:03:47 +04:00
|
|
|
};
|