Email
Configuration
First we have to make an entry in
MSGTYPES table in our database.
In MSGTYPES table we have to enter
For example:
Name – SendEmail (Name of the new
Mesgtype)
ViewName – SendEmailView (Name of the
View for sending EMAIL)
Description – SendEmail
Once the table entry is done then logon
to ADMIN console of WCS.
Click on Configuration Transports
Click on Email link
SMTP Configuration
To configure Message type to send
EMAIL: To configuration >> Message Types
Create New Message Type:
Message Type : You will select the
message type from drop down, check for name which you have entered in
Database in first step: (here SendEmail)
Transport : Will be EMAIL
Device Format : Standard Device
Format
>>>>> Click on Next
>>>>>>
After this configuration from Admin
Console then we will write code to send the mail to particular user.
- Register the View (here SendEmailView)
<forward name="SendEmailView/0/-3" path="/MyNewView.jsp"
className="com.ibm.commerce.struts.ECActionForward">
<set-property property="resourceClassName"
value="com.ibm.commerce.command.HttpForwardViewCommandImpl"/>
<set-property property="interfaceName"
value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/>
<set-property property="implClassName"
value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
<set-property property="direct" value="true"/>
</forward>
<action
path="/SendEmailView"
type="com.ibm.commerce.struts.BaseAction">
Code to be placed in java
==================================================================================
String strMethodName = "SendEmail";
SendMsgCmd cmdSendMsg =
(SendMsgCmd)CommandFactory.createCommand("com.ibm.commerce.messaging.commands.SendMsgCmd", getStoreId());
cmdSendMsg.setMsgType("SendEmail");
// Get the details of Registered Message Type
cmdSendMsg.setCommandContext(getCommandContext());
// set the command context
cmdSendMsg.setStoreID(commandContext.getStoreId());
cmdSendMsg.setConfigData("sender","harpreetsinghdelhi@gmail.com");
// Sender’s Email
cmdSendMsg.setConfigData("recipient","harpreetsinghdelhi@gmail.com");
//receiver’s Email
cmdSendMsg.setConfigData("subject","Test
Mail"); // Subject Name
cmdSendMsg.compose(null,getCommandContext(),getRequestProperties());
// composing Mail
cmdSendMsg.sendImmediate(); // Executing Mail
If we want to send some dynamic values
to a JSP, we can achieve by using Typed Properties.
WE can place all the properties using
Typedproperty class, and then we can fetch all those properties in a
JSP which we have registered against the Message Type.
We can send the Typed properties or
else we can also send the whole request object also while composing
cmdSendMsg.compose(null,getCommandContext(),TypedPropertyObj);
// composing Mail
Good Job, the article is so useful Advance Bulk Mailer.
ReplyDeleteCASINO ROULETTE HOTEL & CASINO RESORT - Mapyro
ReplyDeleteHotels near CASINO ROULETTE HOTEL & CASINO RESORT · Candlewood Tower Resort · 속초 출장마사지 Holiday 여주 출장샵 Inn Express Hotel · The Best 충청북도 출장샵 Las 통영 출장샵 Vegas Hotels 서귀포 출장안마 by Marriott