-1

嗨,朋友们,我是 Sencha 的新手。我想做电子邮件功能,请帮帮我。这是我的代码:

Ext.define('NotesApp.view.NoteSettings', {
    extend: 'Ext.form.Panel', 
    xtype: 'formpanel',
    id: 'contactForm',
    url: 'feedback.php',                    
    layout: 'vbox',
    alias: 'widget.notesettingsview',
    config: {
        title: 'Contact',
        iconCls: 'user',
        items: [
            {
                xtype: 'fieldset',
                title: 'Contact Us',
                instructions: '(email is not required)',

                items: [
                    {
                        xtype: 'textfield',
                        name: 'name',
                        label: 'Name'
                    },
                    {
                        xtype: 'emailfield',
                        name: 'email',
                        label: 'Email'
                    },
                    {
                        xtype: 'textareafield',
                        name: 'message',
                        label: 'Message'
                    }
                ]
            },
            {
                items: [
                    {
                        xtype: 'button',
                        text: 'Submit',
                        ui: 'confirm',

                        handler: function(){
                            var values = Ext.getCmp('contactForm').getValues();
                            // prints the values filled in the form 
                            // text fields of name, email and message.     
                            console.log(values.name+","+values.email+","+values.message);                          


                            Ext.Ajax.request({
                                url: 'feedback.php',
                                params : values,
                                success: function(response){
                                    var text = response.responseText;
                                    Ext.Msg.alert('Success', text); 
                                }
                            });     
                        }
                    }
                ]
            }
        ]
    }
});
4

1 回答 1

1

Sencha 不提供任何“电子邮件功能”。你需要使用一些外部 api 来实现这一点。A在网上快速搜索了一下,我发现了这个:

http://www.jamesyu.org/2011/02/05/introducing-gmailr-an-unofficial-javscript-api-for-gmail/

也许您可以使用它或将其作为代码的基础。

此致。

于 2012-09-12T15:01:02.630 回答