• adiez
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Hi all.

I'm experimenting with sending mail from APEX and have a serious problem... It isn't sent. I put the code below, but is the typical code you can find in these forums:

 

public class newController { public String myMessages {get{return this.myMessages;}set;} public newController (){ // Create a new single email message object // that will send out a single email to the addresses in the To, CC & BCC list. Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); // Strings to hold the email addresses to which you are sending the email. String[] toAddresses = new String[] {'myadress@one.com'}; String[] ccAddresses = new String[] {'otheradress@yahoo.es'}; // Assign the addresses for the To and CC lists to the mail object. mail.setToAddresses(toAddresses); mail.setCcAddresses(ccAddresses); // Specify the address used when the recipients reply to the email. mail.setReplyTo('adiez@proclientia.com'); // Specify the name used as the display name. mail.setSenderDisplayName('Salesforce Support'); // Specify the subject line for your email address. mail.setSubject('New Case Created : '); // Set to True if you want to BCC yourself on the email. mail.setBccSender(true); // Optionally append the salesforce.com email signature to the email. // The email address of the user executing the Apex Code will be used. mail.setUseSignature(false); // Specify the text content of the email. mail.setPlainTextBody('Your Case: has been created'); mail.setHtmlBody('Your case:<b> blablabla </b>has been created<p>'+ ' View case <a href=http://www.google.es>click here</a>'); // Send the email you have created. this.myMessages = ''+Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); } }

 and my VF page:

 

<apex:page controller="newController"> {!myMessages} </apex:page>

 The result:

 

(Messaging.SendEmailResult[getErrors=();isSuccess=true;])

 

So, why not send the email?

thanks in advance.

adiez

Salesforce Consulting Partner in Spain

www.proclientia.com

 

 

 

 

  • June 01, 2009
  • Like
  • 0

Hi all.

I'm experimenting with sending mail from APEX and have a serious problem... It isn't sent. I put the code below, but is the typical code you can find in these forums:

 

public class newController { public String myMessages {get{return this.myMessages;}set;} public newController (){ // Create a new single email message object // that will send out a single email to the addresses in the To, CC & BCC list. Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); // Strings to hold the email addresses to which you are sending the email. String[] toAddresses = new String[] {'myadress@one.com'}; String[] ccAddresses = new String[] {'otheradress@yahoo.es'}; // Assign the addresses for the To and CC lists to the mail object. mail.setToAddresses(toAddresses); mail.setCcAddresses(ccAddresses); // Specify the address used when the recipients reply to the email. mail.setReplyTo('adiez@proclientia.com'); // Specify the name used as the display name. mail.setSenderDisplayName('Salesforce Support'); // Specify the subject line for your email address. mail.setSubject('New Case Created : '); // Set to True if you want to BCC yourself on the email. mail.setBccSender(true); // Optionally append the salesforce.com email signature to the email. // The email address of the user executing the Apex Code will be used. mail.setUseSignature(false); // Specify the text content of the email. mail.setPlainTextBody('Your Case: has been created'); mail.setHtmlBody('Your case:<b> blablabla </b>has been created<p>'+ ' View case <a href=http://www.google.es>click here</a>'); // Send the email you have created. this.myMessages = ''+Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); } }

 and my VF page:

 

<apex:page controller="newController"> {!myMessages} </apex:page>

 The result:

 

(Messaging.SendEmailResult[getErrors=();isSuccess=true;])

 

So, why not send the email?

thanks in advance.

adiez

Salesforce Consulting Partner in Spain

www.proclientia.com

 

 

 

 

  • June 01, 2009
  • Like
  • 0

Is it possible to write a class that extends a custom VF controller, and then use the new class as the controller for a page?  Can I extend a class that is itself an extension of a standard controller, as opposed to a fully-custom controller?

 

It's the latter that I'm trying to do right now.

 

I tried creating an extension.  I added the "virtual" keyword to my existing controller, then defined a new child class something like so:

 

public class CTRL_CustomWizard extends CTRL_FooWizard {

 

 but I get the error "Parent class has no 0-argument constructor for implicit construction"

 

 

 Does this mean I can't do it, or do I need to do something else?  The constructor in the parent class can't have no arguments, because it's an extension of a standard controller, so the constructor is defined like:

 

public CTRL_FooWizard (ApexPages.StandardController controller) {

 

Thanks much!

 

Message Edited by sparky on 05-28-2009 10:50 PM