You need to sign in to do that
Don't have an account?
satish kumar 498
invalid type error
Hi, i am new to salesforce i am creating pdf attatchment with sending mail...... i get this answer,please help me for this,my code is
public class MyAttatchment {
Account acc;
public String myName{set;get;}
public MyAttatchment(){
acc =[select Id,Name from Account where Name=:myName limit 1];
}
public void pageReferenceShow(){
Messaging.SingleEmailMessage myMail = new Messaging.SingleEmailMessage();
Messaging.EmailFileAttatchment fMail = new Messaging.EmailFileAttatchment();
pageReference pdf = page.Attatchment.pdf;
pdf.getParameters().put(Id,(String.accId));
pdf.setRedirect(true);
Blob b =pdf.getContent();
fMail.setFileName('Attatchment.pdf');
fMail.setBody(b);
myMail.setSubject('MonthBill');
String toAdd = new String[]{'n.satti534@gmail.com'};
myMail.setToAddress(toAdd);
myMail.setBody('Plz Find Attatchment');
myMail.setFileAttachments( new Messaging.EmailFileAttatchment[]{fMail});
Messaging.sendEmail(new Messaging.Email[]{myMail});
return null;
}
}
i get error like this..invalid type:messaging.emailfileattatchment
public class MyAttatchment {
Account acc;
public String myName{set;get;}
public MyAttatchment(){
acc =[select Id,Name from Account where Name=:myName limit 1];
}
public void pageReferenceShow(){
Messaging.SingleEmailMessage myMail = new Messaging.SingleEmailMessage();
Messaging.EmailFileAttatchment fMail = new Messaging.EmailFileAttatchment();
pageReference pdf = page.Attatchment.pdf;
pdf.getParameters().put(Id,(String.accId));
pdf.setRedirect(true);
Blob b =pdf.getContent();
fMail.setFileName('Attatchment.pdf');
fMail.setBody(b);
myMail.setSubject('MonthBill');
String toAdd = new String[]{'n.satti534@gmail.com'};
myMail.setToAddress(toAdd);
myMail.setBody('Plz Find Attatchment');
myMail.setFileAttachments( new Messaging.EmailFileAttatchment[]{fMail});
Messaging.sendEmail(new Messaging.Email[]{myMail});
return null;
}
}
i get error like this..invalid type:messaging.emailfileattatchment
EmailFileAttachment